Skip to content

Commit b5ea08a

Browse files
claudiubezneagregkh
authored andcommitted
usb: renesas_usbhs: Call clk_put()
Clocks acquired with of_clk_get() need to be freed with clk_put(). Call clk_put() on priv->clks[0] on error path. Fixes: 3df0e24 ("usb: renesas_usbhs: Add multiple clocks management") Cc: stable <stable@kernel.org> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://lore.kernel.org/r/20250225110248.870417-2-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 69c58de commit b5ea08a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/renesas_usbhs/common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
312312
priv->clks[1] = of_clk_get(dev_of_node(dev), 1);
313313
if (PTR_ERR(priv->clks[1]) == -ENOENT)
314314
priv->clks[1] = NULL;
315-
else if (IS_ERR(priv->clks[1]))
315+
else if (IS_ERR(priv->clks[1])) {
316+
clk_put(priv->clks[0]);
316317
return PTR_ERR(priv->clks[1]);
318+
}
317319

318320
return 0;
319321
}

0 commit comments

Comments
 (0)