]> 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:27:57 +0000 (18:27 +0200)
commit8e221225643c8ef0b59788c62332171451d5a948
tree8c1b25757b0c2d82be9e18e3d714adc61e5b8d44
parent07e49c6a4f9e4409badc78b00928af4609c60ea4
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 5.15.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