]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: ehci-hcd: fix call balance of clocks handling routines
authorVitalii Mordan <mordan@ispras.ru>
Thu, 21 Nov 2024 11:47:00 +0000 (14:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2024 17:08:49 +0000 (18:08 +0100)
commit02ceda7f649080df4f17b11b52230ae8c70a418a
tree8d4a5d3b1388a989d079d7c6dd3fe2f447e9a446
parente92f79d58246103a2e644bde4988d32196135174
usb: ehci-hcd: fix call balance of clocks handling routines

commit 97264eaaba0122a5b7e8ddd7bf4ff3ac57c2b170 upstream.

If the clocks priv->iclk and priv->fclk were not enabled in ehci_hcd_sh_probe,
they should not be disabled in any path.

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

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

Fixes: 63c845522263 ("usb: ehci-hcd: Add support for SuperH EHCI.")
Cc: stable@vger.kernel.org # ff30bd6a6618: sh: clk: Fix clk_enable() to return 0 on NULL clk
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20241121114700.2100520-1-mordan@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-sh.c