summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-12-27 19:58:10 +0300
committerKalle Valo <quic_kvalo@quicinc.com>2022-01-17 15:41:51 +0300
commita063b650ce5d72585d780d653a123f9f273b7877 (patch)
tree02ee9156abfb15e642fbd250b28d1a23beeed13f /tools/perf/scripts/python/stackcollapse.py
parentf14c3f4db9cb098db70651434588ea519930f5d6 (diff)
downloadlinux-a063b650ce5d72585d780d653a123f9f273b7877.tar.xz
ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation
kmalloc_array()/kcalloc() should be used to avoid potential overflow when a multiplication is needed to compute the size of the requested memory. kmalloc_array() can be used here instead of kcalloc() because the array is fully initialized in the next 'for' loop. Finally, 'cd->detectors' is defined as 'struct pri_detector **detectors;'. So 'cd->detectors' and '*cd->detectors' are both some pointer. So use a more logical 'sizeof(*cd->detectors)'. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/0fbcd32a0384ac1f87c5a3549e505e4becc60226.1640624216.git.christophe.jaillet@wanadoo.fr
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions