]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf sched: Use RC_CHK_EQUAL() to compare pointers
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:40 +0000 (18:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:13:52 +0000 (12:13 +0200)
[ Upstream commit 7a4002ec9e0fced907179da94f67c3082d7b4162 ]

So that it can check two pointers to the same object properly when
REFCNT_CHECKING is on.

Fixes: 78c32f4cb12f9430 ("libperf rc_check: Add RC_CHK_EQUAL")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-7-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-sched.c

index 686747ae4cad5315b129035c49a47d78889e9689..6e9c22c1c29dcacc65765c791b181a54bd18ca2c 100644 (file)
@@ -999,7 +999,7 @@ thread_atoms_search(struct rb_root_cached *root, struct thread *thread,
                else if (cmp < 0)
                        node = node->rb_right;
                else {
-                       BUG_ON(thread != atoms->thread);
+                       BUG_ON(!RC_CHK_EQUAL(thread, atoms->thread));
                        return atoms;
                }
        }