mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
pstree: Drop redundant nil test in prepare_pstree
This as well releases pb entry on error path, not a big deal since we're exiting in case of error but still. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
d82b853dc8
commit
f318f40415
15
pstree.c
15
pstree.c
@@ -160,15 +160,18 @@ int prepare_pstree(void)
|
|||||||
parent = parent->parent;
|
parent = parent->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent == NULL)
|
if (parent == NULL) {
|
||||||
for_each_pstree_item(parent)
|
for_each_pstree_item(parent) {
|
||||||
if (parent->pid.virt == e->ppid)
|
if (parent->pid.virt == e->ppid)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (parent == NULL) {
|
if (parent == NULL) {
|
||||||
pr_err("Can't find a parent for %d", pi->pid.virt);
|
pr_err("Can't find a parent for %d", pi->pid.virt);
|
||||||
xfree(pi);
|
pstree_entry__free_unpacked(e, NULL);
|
||||||
break;
|
xfree(pi);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pi->parent = parent;
|
pi->parent = parent;
|
||||||
|
Reference in New Issue
Block a user