Skip to contentSkip to conversation

Patch "usb: dwc3: of-simple: fix missing clk_disable_unprepare" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 23, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: dwc3: of-simple: fix missing clk_disable_unprepare

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
usb-dwc3-of-simple-fix-missing-clk_disable_unprepare.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Feb 23 11:45:09 CET 2018

From: Andreas Platschek <[email protected]>
Date: Thu, 7 Dec 2017 11:32:20 +0100
Subject: usb: dwc3: of-simple: fix missing clk_disable_unprepare

From: Andreas Platschek <[email protected]>

[ Upstream commit ded600ea9fb51a495d2fcd21e90351df876488e8 ]

If of_clk_get() fails, the clean-up of already initialized clocks should be the same as when clk_prepare_enable() fails. Thus a clk_disable_unprepare() for each clock should be called before the clk_put().

Found by Linux Driver Verification project (linuxtesting.org).

Fixes 16adc674d0d6 ("usb: dwc3: ep0: fix setup_packet_pending initialization")
---
 drivers/usb/dwc3/dwc3-of-simple.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-of-simple.c +3 -1
@@ -57,8 +57,10 @@ static int dwc3_of_simple_clk_init(struc
 
 		clk = of_clk_get(np, i);
 		if (IS_ERR(clk)) {
-			while (--i >= 0)
+			while (--i >= 0) {
+				clk_disable_unprepare(simple->clks[i]);
 				clk_put(simple->clks[i]);
+			}
 			return PTR_ERR(clk);
 		}
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/usb-dwc3-of-simple-fix-missing-clk_disable_unprepare.patch