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) ...@@ -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;
......
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