diff options
author | Duoming Zhou <[email protected]> | 2024-03-01 16:44:37 +0800 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2024-03-08 17:15:20 -0800 |
commit | 7938e9ce39d6779d2f85d822cc930f73420e54a6 (patch) | |
tree | 80f7a3ad4acb25ccce65ad8f7810c66e51d011bc /tools/perf/util/trace-event-scripting.c | |
parent | c1ab111e62496d8c1232da767c2bc5cdc76596e5 (diff) |
clk: zynq: Prevent null pointer dereference caused by kmalloc failure
The kmalloc() in zynq_clk_setup() will return null if the
physical memory has run out. As a result, if we use snprintf()
to write data to the null address, the null pointer dereference
bug will happen.
This patch uses a stack variable to replace the kmalloc().
Fixes: 0ee52b157b8e ("clk: zynq: Add clock controller driver")
Suggested-by: Michal Simek <[email protected]>
Suggested-by: Stephen Boyd <[email protected]>
Signed-off-by: Duoming Zhou <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Michal Simek <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions