]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
libperf cpumap: Fix perf_cpu_map__max for an empty/NULL map
authorIan Rogers <irogers@google.com>
Wed, 3 Dec 2025 21:47:01 +0000 (13:47 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:12 +0000 (10:14 +0100)
commit6b4f044d9cd8a61cfd6ec1e9774ac48b29fcc646
tree83aec888216ef44e9f85c7b0a746d50c71557d9e
parent3f7a5d52a4ea9cc6a4a0dfd19e003fb5e886438d
libperf cpumap: Fix perf_cpu_map__max for an empty/NULL map

[ Upstream commit a0a4173631bfcfd3520192c0a61cf911d6a52c3a ]

Passing an empty map to perf_cpu_map__max triggered a SEGV. Explicitly
test for the empty map.

Reported-by: Ingo Molnar <mingo@kernel.org>
Closes: https://lore.kernel.org/linux-perf-users/aSwt7yzFjVJCEmVp@gmail.com/
Tested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/perf/cpumap.c