]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2024 11:19:01 +0000 (12:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Dec 2024 11:19:01 +0000 (12:19 +0100)
added patches:
usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch

queue-5.4/series
queue-5.4/usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch [new file with mode: 0644]

index 8a8899e557a094fec97627eff2fc44b600b83f13..5e7266966e8dcc476e8d549a866b615977f24f32 100644 (file)
@@ -141,3 +141,4 @@ misc-apds990x-fix-missing-pm_runtime_disable.patch
 staging-greybus-uart-clean-up-tiocgserial.patch
 staging-greybus-uart-fix-atomicity-violation-in-get_.patch
 apparmor-fix-do-simple-duplicate-message-elimination.patch
+usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch
diff --git a/queue-5.4/usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch b/queue-5.4/usb-ehci-spear-fix-call-balance-of-sehci-clk-handling-routines.patch
new file mode 100644 (file)
index 0000000..dc7e528
--- /dev/null
@@ -0,0 +1,50 @@
+From 40c974826734836402abfd44efbf04f63a2cc1c1 Mon Sep 17 00:00:00 2001
+From: Vitalii Mordan <mordan@ispras.ru>
+Date: Fri, 15 Nov 2024 02:03:10 +0300
+Subject: usb: ehci-spear: fix call balance of sehci clk handling routines
+
+From: Vitalii Mordan <mordan@ispras.ru>
+
+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 |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/ehci-spear.c
++++ b/drivers/usb/host/ehci-spear.c
+@@ -110,7 +110,9 @@ static int spear_ehci_hcd_drv_probe(stru
+       /* registers start at offset 0x0 */
+       hcd_to_ehci(hcd)->caps = hcd->regs;
+-      clk_prepare_enable(sehci->clk);
++      retval = clk_prepare_enable(sehci->clk);
++      if (retval)
++              goto err_put_hcd;
+       retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
+       if (retval)
+               goto err_stop_ehci;
+@@ -135,8 +137,7 @@ static int spear_ehci_hcd_drv_remove(str
+       usb_remove_hcd(hcd);
+-      if (sehci->clk)
+-              clk_disable_unprepare(sehci->clk);
++      clk_disable_unprepare(sehci->clk);
+       usb_put_hcd(hcd);
+       return 0;