Skip to content

Commit

Permalink
net: stmmac: fix missing unlock on error in stmmac_suspend()
Browse files Browse the repository at this point in the history
commit 30f347a upstream

Add the missing unlock before return from stmmac_suspend()
in the error handling case.

Fixes: 5ec5582 ("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>
Signed-off-by: Meng Li <Meng.Li@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Nov 21, 2021
1 parent 483ed89 commit bcf3752
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5275,8 +5275,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);

Expand Down

0 comments on commit bcf3752

Please sign in to comment.