[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158470908138.28353.6741541578450083595.tip-bot2@tip-bot2>
Date: Fri, 20 Mar 2020 12:58:01 -0000
From: "tip-bot2 for Dan Carpenter" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/core] perf/core: Fix reversed NULL check in
perf_event_groups_less()
The following commit has been merged into the perf/core branch of tip:
Commit-ID: a6763625ae6f8aa5ee82fcd8fa4e5e38db20dbc6
Gitweb: https://git.kernel.org/tip/a6763625ae6f8aa5ee82fcd8fa4e5e38db20dbc6
Author: Dan Carpenter <dan.carpenter@...cle.com>
AuthorDate: Thu, 12 Mar 2020 13:56:37 +03:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Fri, 20 Mar 2020 13:06:22 +01:00
perf/core: Fix reversed NULL check in perf_event_groups_less()
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)
Fixes: 95ed6c707f26 ("perf/cgroup: Order events in RB tree by cgroup id")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lkml.kernel.org/r/20200312105637.GA8960@mwanda
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index b5a68d2..d22e4ba 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1586,7 +1586,7 @@ perf_event_groups_less(struct perf_event *left, struct perf_event *right)
*/
return true;
}
- if (!right->cgrp || right->cgrp->css.cgroup) {
+ if (!right->cgrp || !right->cgrp->css.cgroup) {
/*
* Right has no cgroup but left does, no cgroups come
* first.
Powered by blists - more mailing lists