aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-stm32.c
diff options
context:
space:
mode:
authorUwe Kleine-König <[email protected]>2024-10-03 13:42:17 +0200
committerUwe Kleine-König <[email protected]>2024-10-04 19:03:12 +0200
commit9c918959e198d25bd3d55068331312812406dec2 (patch)
tree245bf3633a8fc92d8d8dba190045eda0f7fee1c9 /drivers/pwm/pwm-stm32.c
parentdab9cd4b8e7f5fce4e7a0424991ec4714a780f3f (diff)
pwm: stm32: Fix error checking for a regmap_read() call
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]>
Diffstat (limited to 'drivers/pwm/pwm-stm32.c')
-rw-r--r--drivers/pwm/pwm-stm32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index d2c1085aee74..b889e64522c3 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -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;