[PATCH v4] clk: zynq: Prevent null pointer dereference caused by kmalloc failure

Stephen Boyd sboyd at kernel.org
Fri Mar 8 17:15:37 PST 2024


Quoting Duoming Zhou (2024-03-01 00:44:37)
> 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 at amd.com>
> Suggested-by: Stephen Boyd <sboyd at kernel.org>
> Signed-off-by: Duoming Zhou <duoming at zju.edu.cn>
> ---

Applied to clk-next



More information about the linux-arm-kernel mailing list