summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2026-08-03 23:34:02 +0200
committerMikulas Patocka <mpatocka@redhat.com>2026-08-04 10:20:10 +0200
commitcc87e26d9cce22061dc21e51e11afef29dbbc36a (patch)
tree4018ab2b09f3fa7686c1add95f9c337a128316de /tools/perf/scripts/python/stackcollapse.py
parent4538a287bdf5d0f9a379c678e5262b9f5783f547 (diff)
dm-stats: fix a crash if allocation of per-cpu data fails
If "dm_kvzalloc(percpu_alloc_size, cpu_to_node(cpu))" fails, the code jumps to the "out" label and calls dm_stat_free. dm_stat_free does "for_each_possible_cpu(cpu) { dm_kvfree(s->stat_percpu[cpu][0].histogram, s->histogram_alloc_size);", which crashes with NULL pointer dereference if s->stat_percpu[cpu] is NULL. This commit fixes the bug by testing s->stat_percpu[cpu] for NULL before using it. Reported-by: Junzhe Yu <junzheyu1@gmail.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Fixes: fd2ed4d25270 ("dm: add statistics support") Cc: stable@vger.kernel.org
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions