Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220112111724.GB3019@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dan Carpenter and committed by
Vinod Koul
cfc826c8 37291f60

+1 -1
+1 -1
drivers/phy/st/phy-stm32-usbphyc.c
··· 304 304 305 305 ret = __stm32_usbphyc_pll_disable(usbphyc); 306 306 if (ret) 307 - return ret; 307 + goto dec_n_pll_cons; 308 308 } 309 309 310 310 ret = stm32_usbphyc_regulators_enable(usbphyc);