Commit f318f404 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d82b853d
......@@ -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);
pstree_entry__free_unpacked(e, NULL);
xfree(pi);
break;
goto err;
}
}
pi->parent = parent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment