summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-10-09 17:02:57 +0800
committerMark Brown <broonie@kernel.org>2014-10-20 12:25:02 +0100
commitfb70067e4a2cc45d273864f071fd6cf62143137a (patch)
tree853f7f6971a9d336adb2d32a6a9ac12feb4bc753 /tools/perf/scripts/python
parent06f9c24e55075e50ebc8b249a7853ad31bc1b3d1 (diff)
regmap: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error.
When all the registers are volatile(unlikely, but logically and mostly will happen for some 'device' who has very few registers), then the count will be euqal to 0, then kmalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16). So this patch fix this with just doing the zero check before calling kmalloc(). If the count == 0, so we can make sure that all the registers are volatile, so no cache is need. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions