Skip to content

Commit 9c91895

Browse files
ukleinekUwe Kleine-König
authored andcommitted
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: deaba9c ("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]>
1 parent dab9cd4 commit 9c91895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int stm32_pwm_write_waveform(struct pwm_chip *chip,
334334
goto out;
335335
}
336336

337-
regmap_read(priv->regmap, TIM_ARR, &arr);
337+
ret = regmap_read(priv->regmap, TIM_ARR, &arr);
338338
if (ret)
339339
goto out;
340340

0 commit comments

Comments
 (0)