diff options
author | Lv Ruyi <lv.ruyi@zte.com.cn> | 2021-11-30 14:24:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-30 15:30:26 +0300 |
commit | 9c32950f24f9e7df158887bdc80e5b79fbf5ed8d (patch) | |
tree | 8cf80958d31b45645e9d76200510284a42b7a84e /drivers | |
parent | c0190879323f88be22a0debda814680dc6e66751 (diff) | |
download | linux-9c32950f24f9e7df158887bdc80e5b79fbf5ed8d.tar.xz |
net: mscc: ocelot: fix mutex_lock not released
If err is true, the function will be returned, but mutex_lock isn't
released.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index fe8abb30f185..b1856d8c944b 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -1651,8 +1651,10 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr) } err = ocelot_setup_ptp_traps(ocelot, port, l2, l4); - if (err) + if (err) { + mutex_unlock(&ocelot->ptp_lock); return err; + } if (l2 && l4) cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; |