]> www.infradead.org Git - users/jedix/linux-maple.git/commit
pwm: stm32: Fix error checking for a regmap_read() call
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Thu, 3 Oct 2024 11:42:17 +0000 (13:42 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Fri, 4 Oct 2024 17:03:12 +0000 (19:03 +0200)
commit9c918959e198d25bd3d55068331312812406dec2
tree245bf3633a8fc92d8d8dba190045eda0f7fee1c9
parentdab9cd4b8e7f5fce4e7a0424991ec4714a780f3f
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: deaba9cff809 ("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>
drivers/pwm/pwm-stm32.c