[PATCH v2] clk: bcm: rpi: Add NULL check in raspberrypi_clk_register()

Stephen Boyd sboyd at kernel.org
Tue May 6 14:42:14 PDT 2025


Quoting Henry Martin (2025-04-01 19:05:13)
> devm_kasprintf() returns NULL when memory allocation fails. Currently,
> raspberrypi_clk_register() does not check for this case, which results
> in a NULL pointer dereference.
> 
> Add NULL check after devm_kasprintf() to prevent this issue.
> 
> Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks")
> Signed-off-by: Henry Martin <bsdhenrymartin at gmail.com>
> Reviewed-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
> ---

Applied to clk-next



More information about the linux-arm-kernel mailing list