mirror of
https://github.com/systemd/systemd.git
synced 2025-01-23 02:04:32 +03:00
bootchart: Remove unneeded check for NULL
Directly before the changed line there is: while ((parent->next_ps && parent->pid != ps->ppid)) parent = parent->next_ps; which looks one element ahead of the list, hence we can rely on parent being non null here. If 'parent' were NULL at that while loop already, it would crash as we're dereferencing 'parent' when checking for next_ps already. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
This commit is contained in:
parent
8181565124
commit
226b735a74
@ -345,7 +345,7 @@ schedstat_next:
|
||||
while ((parent->next_ps && parent->pid != ps->ppid))
|
||||
parent = parent->next_ps;
|
||||
|
||||
if ((!parent) || (parent->pid != ps->ppid)) {
|
||||
if (parent->pid != ps->ppid) {
|
||||
/* orphan */
|
||||
ps->ppid = 1;
|
||||
parent = ps_first->next_ps;
|
||||
|
Loading…
x
Reference in New Issue
Block a user