[Linux-stm32] [PATCH net-next] net: stmmac: fix missing unlock on error in stmmac_suspend()

Edmundo Carmona Antoranz eantoranz at gmail.com
Tue Mar 16 13:50:51 UTC 2021


On Tue, Mar 16, 2021 at 3:21 AM 'w00385741 <weiyongjun1 at huawei.com> wrote:
>
> -               if (ret)
> +               if (ret) {
> +                       mutex_unlock(&priv->lock);
>                         return ret;
> +               }
>         }
>         mutex_unlock(&priv->lock);
>

I think you can let it go and check ret after unlocking:

                /* Disable clock in case of PWM is off */
               clk_disable_unprepare(priv->plat->clk_ptp_ref);
               ret = pm_runtime_force_suspend(dev);
       }
       mutex_unlock(&priv->lock);
       if (ret)
               return ret;

       priv->speed = SPEED_UNKNOWN;
       return 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20210316/95f15572/attachment.html>


More information about the Linux-stm32 mailing list