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 <kees@ijzerbout.nl> Link: https://lore.kernel.org/linux-pwm/b0199625-9dbb-414b-8948-26ad86fd2740@ijzerbout.nl Fixes: deaba9c ("pwm: stm32: Implementation of the waveform callbacks") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/20241003114216.163715-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
1 parent dab9cd4 commit 9c91895

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)