Skip to contentSkip to conversation

phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable()

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 12, 2022 – Jan 27, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable()

This error path needs to decrement "usbphyc->n_pll_cons.counter" before returning.

Fixes 5b1af71280ab ("phy: stm32: rework PLL Lock detection")
---
 drivers/phy/st/phy-stm32-usbphyc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/st/phy-stm32-usbphyc.c +1 -1
index 2ce9bfd783d4..007a23c78d56 100644
@@ -304,7 +304,7 @@ static int stm32_usbphyc_pll_enable(struct stm32_usbphyc *usbphyc)
 
 		ret = __stm32_usbphyc_pll_disable(usbphyc);
 		if (ret)
-			return ret;
+			goto dec_n_pll_cons;
 	}
 
 	ret = stm32_usbphyc_regulators_enable(usbphyc);
Signature · 7 lines
2.20.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
maintainer Applied
#1 lore raw
Quoted 2 lines · Dan Carpenter

This error path needs to decrement "usbphyc->n_pll_cons.counter" before returning.

Applied, thanks

Signature · 1 line
~Vinod