ptdev: bug fix on operating list

Before using a node of list, initialize it.

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Reviewed-by: Yakui, Zhao <yakui.zhao@intel.com>
Reviewed-by: Chen, Jason Cl <jason.cj.chen@intel.com>
This commit is contained in:
Zheng, Gen 2018-04-12 09:40:19 +08:00 committed by Jack Ren
parent 72b2cb1fa7
commit 7ed446e63b

View File

@ -166,6 +166,10 @@ alloc_entry(struct vm *vm, enum ptdev_intr_type type)
ASSERT(entry, "alloc memory failed");
entry->type = type;
entry->vm = vm;
INIT_LIST_HEAD(&entry->softirq_node);
INIT_LIST_HEAD(&entry->entry_node);
atomic_clear_int(&entry->active, ACTIVE_FLAG);
list_add(&entry->entry_node, &ptdev_list);