]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: ehci-spear: fix call balance of sehci clk handling routines
authorVitalii Mordan <mordan@ispras.ru>
Thu, 14 Nov 2024 23:03:10 +0000 (02:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:11 +0000 (19:51 +0100)
commit3504696ecfb6d78c2d69aebce9b2bb3a31b6590a
treef63ed8e4476088d46c55c59b677a9c729d1b0a3c
parentab011f7439d9bbfd34fd3b9cef4b2d6d952c9bb9
usb: ehci-spear: fix call balance of sehci clk handling routines

commit 40c974826734836402abfd44efbf04f63a2cc1c1 upstream.

If the clock sehci->clk was not enabled in spear_ehci_hcd_drv_probe,
it should not be disabled in any path.

Conversely, if it was enabled in spear_ehci_hcd_drv_probe, it must be disabled
in all error paths to ensure proper cleanup.

Found by Linux Verification Center (linuxtesting.org) with Klever.

Fixes: 7675d6ba436f ("USB: EHCI: make ehci-spear a separate driver")
Cc: stable@vger.kernel.org
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20241114230310.432213-1-mordan@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-spear.c