]> git.hungrycats.org Git - linux/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>
Thu, 5 Dec 2024 12:54:06 +0000 (13:54 +0100)
commit5498c8792d927bac8bc067baeb51b697e09ca7a6
treee69cc64290a80c8d40e544ec07b9c5a0d5a77c05
parentea0fa76f61cf8e932d1d26e6193513230816e11d
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