mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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: deaba9cff8
("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>
This commit is contained in:
parent
dab9cd4b8e
commit
9c918959e1
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user