This NULL check is reversed so it leads to a Smatch warning and presumably a NULL dereference. kernel/events/core.c:1598 perf_event_groups_less() error: we previously assumed 'right->cgrp->css.cgroup' could be null (see line 1590)
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -1586,7 +1586,7 @@ perf_event_groups_less(struct perf_event *left, struct perf_event *right) · 1585 unmodified lines | |||
| 1586 | */ | 1586 | */ |
| 1587 | return true; | 1587 | return true; |
| 1588 | } | 1588 | } |
| 1589 | if (!right->cgrp || right->cgrp->css.cgroup) { | 1589 | if (!right->cgrp || !right->cgrp->css.cgroup) { |
| 1590 | /* | 1590 | /* |
| 1591 | * Right has no cgroup but left does, no cgroups come | 1591 | * Right has no cgroup but left does, no cgroups come |
| 1592 | * first. | 1592 | * first. |