]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: stmmac: fix missing unlock on error in stmmac_suspend()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 27 Mar 2021 09:33:22 +0000 (17:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Mar 2021 01:00:00 +0000 (18:00 -0700)
Add the missing unlock before return from stmmac_suspend()
in the error handling case.

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 3a4f0c2d42a3113b281c2722ccd8858769b5456b..d34388b1ffcc1c5d9f554f507808942552a12849 100644 (file)
@@ -5964,8 +5964,10 @@ int stmmac_suspend(struct device *dev)
                /* Disable clock in case of PWM is off */
                clk_disable_unprepare(priv->plat->clk_ptp_ref);
                ret = pm_runtime_force_suspend(dev);
-               if (ret)
+               if (ret) {
+                       mutex_unlock(&priv->lock);
                        return ret;
+               }
        }
 
        mutex_unlock(&priv->lock);