summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>2025-02-25 13:02:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-13 12:53:19 +0100
commit3d7f7a149ce2dca669021fb3fd7c3d98ca1918a8 (patch)
treefdcf3ff6a60b94d1efe754967285a7a18bf41793 /drivers/usb
parenta55aa36d457c82e22302e77739d2c4f30d13f729 (diff)
downloadlinux-3d7f7a149ce2dca669021fb3fd7c3d98ca1918a8.tar.gz
linux-3d7f7a149ce2dca669021fb3fd7c3d98ca1918a8.tar.bz2
linux-3d7f7a149ce2dca669021fb3fd7c3d98ca1918a8.zip
usb: renesas_usbhs: Call clk_put()
commit b5ea08aa883da05106fcc683d12489a4292d1122 upstream. Clocks acquired with of_clk_get() need to be freed with clk_put(). Call clk_put() on priv->clks[0] on error path. Fixes: 3df0e240caba ("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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/renesas_usbhs/common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 96f3939a65e2..a29c348bfb03 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -312,8 +312,10 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
priv->clks[1] = of_clk_get(dev_of_node(dev), 1);
if (PTR_ERR(priv->clks[1]) == -ENOENT)
priv->clks[1] = NULL;
- else if (IS_ERR(priv->clks[1]))
+ else if (IS_ERR(priv->clks[1])) {
+ clk_put(priv->clks[0]);
return PTR_ERR(priv->clks[1]);
+ }
return 0;
}