Message ID | 20211130112443.309708-1-lv.ruyi@zte.com.cn (mailing list archive) |
---|---|
State | Accepted |
Commit | 9c32950f24f9e7df158887bdc80e5b79fbf5ed8d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: mscc: ocelot: fix mutex_lock not released | expand |
Hello: This patch was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: On Tue, 30 Nov 2021 11:24:43 +0000 you wrote: > From: Lv Ruyi <lv.ruyi@zte.com.cn> > > 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> > > [...] Here is the summary with links: - net: mscc: ocelot: fix mutex_lock not released https://git.kernel.org/netdev/net-next/c/9c32950f24f9 You are awesome, thank you!
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;