]> Git Repo - J-linux.git/commitdiff
pwm: stm32: Fix error checking for a regmap_read() call
authorUwe Kleine-König <[email protected]>
Thu, 3 Oct 2024 11:42:17 +0000 (13:42 +0200)
committerUwe Kleine-König <[email protected]>
Fri, 4 Oct 2024 17:03:12 +0000 (19:03 +0200)
Without first assigning ret, it always evaluates to zero because
otherwise this code isn't reached. So assign the return code of
regmap_read() to ret to make the following error path do something.

This issue was spotted by Coverity.

Reported-by: Kees Bakker <[email protected]>
Link: https://lore.kernel.org/linux-pwm/[email protected]
Fixes: deaba9cff809 ("pwm: stm32: Implementation of the waveform callbacks")
Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
drivers/pwm/pwm-stm32.c

index d2c1085aee74e9d848f33860619c624c1c6e6df0..b889e64522c3d7b6a6ea5649f2b3ed18faf84500 100644 (file)
@@ -334,7 +334,7 @@ static int stm32_pwm_write_waveform(struct pwm_chip *chip,
                                goto out;
                        }
 
-                       regmap_read(priv->regmap, TIM_ARR, &arr);
+                       ret = regmap_read(priv->regmap, TIM_ARR, &arr);
                        if (ret)
                                goto out;
 
This page took 0.062581 seconds and 4 git commands to generate.