This is a note to let you know that I've just added the patch titled pwm: stm32: Add check for clk_enable() to the 6.6-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: pwm-stm32-add-check-for-clk_enable.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 3762c920d35f73db3fff3759ca8953b168175c55 Author: Mingwei Zheng <zmw12306@xxxxxxxxx> Date: Sun Dec 15 17:47:52 2024 -0500 pwm: stm32: Add check for clk_enable() [ Upstream commit e8c59791ebb60790c74b2c3ab520f04a8a57219a ] Add check for the return value of clk_enable() to catch the potential error. Fixes: 19f1016ea960 ("pwm: stm32: Fix enable count for clk in .probe()") Signed-off-by: Mingwei Zheng <zmw12306@xxxxxxxxx> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@xxxxxxxxx> Link: https://lore.kernel.org/r/20241215224752.220318-1-zmw12306@xxxxxxxxx Signed-off-by: Uwe Kleine-König <ukleinek@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index b91a14c895bea..67414b97ef4d2 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -635,8 +635,11 @@ static int stm32_pwm_probe(struct platform_device *pdev) priv->chip.npwm = stm32_pwm_detect_channels(priv, &num_enabled); /* Initialize clock refcount to number of enabled PWM channels. */ - for (i = 0; i < num_enabled; i++) - clk_enable(priv->clk); + for (i = 0; i < num_enabled; i++) { + ret = clk_enable(priv->clk); + if (ret) + return ret; + } ret = devm_pwmchip_add(dev, &priv->chip); if (ret < 0)