mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
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: 00093b3133 ("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>
This commit is contained in:
parent
05134d1537
commit
b03b95b4d7
|
|
@ -4714,6 +4714,11 @@ static int perf_sched__schedstat_live(struct perf_sched *sched,
|
|||
|
||||
nr = cpu__max_present_cpu().cpu;
|
||||
cd_map = build_cpu_domain_map(&sv, &md, nr);
|
||||
if (!cd_map) {
|
||||
pr_err("Unable to generate cpu-domain relation info");
|
||||
goto out;
|
||||
}
|
||||
|
||||
show_schedstat_data(&cpu_head, cd_map, NULL, NULL, false);
|
||||
free_cpu_domain_info(cd_map, sv, nr);
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user