]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pwm: mediatek: Ensure to disable clocks in error path
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Fri, 4 Jul 2025 17:27:27 +0000 (19:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:32:09 +0000 (18:32 +0200)
commit5cf70d19e310de8b83fffec73211ce69c14b5d20
treeebc59025d1979e7627f95874b9400358a660258a
parenta1802098ef78a0d1c6c46c08f44b8a182a261490
pwm: mediatek: Ensure to disable clocks in error path

commit 505b730ede7f5c4083ff212aa955155b5b92e574 upstream.

After enabling the clocks each error path must disable the clocks again.
One of them failed to do so. Unify the error paths to use goto to make it
harder for future changes to add a similar bug.

Fixes: 7ca59947b5fc ("pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20250704172728.626815-2-u.kleine-koenig@baylibre.com
Cc: stable@vger.kernel.org
[ukleinek: backported to 6.6.y]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/pwm-mediatek.c