This is a note to let you know that I've just added the patch titled clk: clocking-wizard: check return value of devm_kasprintf() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: clk-clocking-wizard-check-return-value-of-devm_kaspr.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 43d0645eab6b643c4b3c2f587320ba8b8f907abe Author: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx> Date: Tue May 30 12:39:13 2023 +0300 clk: clocking-wizard: check return value of devm_kasprintf() [ Upstream commit b1356ed1a4461de06dfdc02bf549c3e8750162e5 ] devm_kasprintf() returns a pointer to dynamically allocated memory. Pointer could be NULL in case allocation fails. Check pointer validity. Identified with coccinelle (kmerr.cocci script). Fixes: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230530093913.1656095-9-claudiu.beznea@xxxxxxxxxxxxx Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index cda1e5be305a4..09a95c02ec5f6 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -645,6 +645,11 @@ static int clk_wzrd_probe(struct platform_device *pdev) } clkout_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s_out0", dev_name(&pdev->dev)); + if (!clkout_name) { + ret = -ENOMEM; + goto err_disable_clk; + } + if (nr_outputs == 1) { clk_wzrd->clkout[0] = clk_wzrd_register_divider (&pdev->dev, clkout_name,