2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +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:
Cyrill Gorcunov 2012-10-03 17:29:04 +04:00 committed by Pavel Emelyanov
parent d82b853dc8
commit f318f40415

View File

@ -160,15 +160,18 @@ int prepare_pstree(void)
parent = parent->parent;
}
if (parent == NULL)
for_each_pstree_item(parent)
if (parent == NULL) {
for_each_pstree_item(parent) {
if (parent->pid.virt == e->ppid)
break;
}
if (parent == NULL) {
pr_err("Can't find a parent for %d", pi->pid.virt);
xfree(pi);
break;
if (parent == NULL) {
pr_err("Can't find a parent for %d", pi->pid.virt);
pstree_entry__free_unpacked(e, NULL);
xfree(pi);
goto err;
}
}
pi->parent = parent;