]> git.ipfire.org Git - thirdparty/linux.git/commit
perf sched stats: Add NULL check for cd_map
authorSwapnil Sapkal <swapnil.sapkal@amd.com>
Tue, 27 Jan 2026 18:49:57 +0000 (18:49 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Jan 2026 18:18:31 +0000 (15:18 -0300)
commitb03b95b4d71edbb10bfb1588dc59cfea8d13796c
treecc7e0919ac209bd11878033a83d8d96bb21e050b
parent05134d15375ce9fc57a91453999729d861efe9f9
perf sched stats: Add NULL check for cd_map

In perf_sched__schedstat_live(), build_cpu_domain_map() returns the
pointer to cpu_domain_map which can also be NULL.

Add NULL check for the same to avoid NULL pointer dereference.

Fixes: 00093b3133984ffe ("perf sched stats: Add support for live mode")
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anubhav Shelat <ashelat@redhat.com>
Cc: Chen Yu <yu.c.chen@intel.com>
Cc: Gautham Shenoy <gautham.shenoy@amd.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-sched.c