diff options
author | Duoming Zhou <duoming@zju.edu.cn> | 2024-03-01 11:44:37 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2024-03-09 04:15:20 +0300 |
commit | 7938e9ce39d6779d2f85d822cc930f73420e54a6 (patch) | |
tree | 80f7a3ad4acb25ccce65ad8f7810c66e51d011bc /fs/btrfs/space-info.h | |
parent | c1ab111e62496d8c1232da767c2bc5cdc76596e5 (diff) | |
download | linux-7938e9ce39d6779d2f85d822cc930f73420e54a6.tar.xz |
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 <michal.simek@amd.com>
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20240301084437.16084-1-duoming@zju.edu.cn
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'fs/btrfs/space-info.h')
0 files changed, 0 insertions, 0 deletions