]> Git Repo - linux.git/commitdiff
phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable()
authorDan Carpenter <[email protected]>
Wed, 12 Jan 2022 11:17:24 +0000 (14:17 +0300)
committerVinod Koul <[email protected]>
Thu, 27 Jan 2022 05:34:40 +0000 (11:04 +0530)
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 <[email protected]>
Link: https://lore.kernel.org/r/20220112111724.GB3019@kili
Signed-off-by: Vinod Koul <[email protected]>
drivers/phy/st/phy-stm32-usbphyc.c

index 2ce9bfd783d45cf148fdfd87f29690219d3868ea..007a23c78d56249de1b94bb3277764cc7d154023 100644 (file)
@@ -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);
This page took 0.054109 seconds and 4 git commands to generate.