Message ID | 20211129151652.1165433-1-weiyongjun1@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1a59c9c55585e1ec5b352d31b3f8402f196eae94 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set() | expand |
On Mon, Nov 29, 2021 at 03:16:52PM +0000, Wei Yongjun wrote: > Add the missing mutex_unlock before return from function > ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error > handling case. > > Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > --- Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Mon, 29 Nov 2021 15:16:52 +0000 you wrote: > Add the missing mutex_unlock before return from function > ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error > handling case. > > Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > > [...] Here is the summary with links: - [net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set() https://git.kernel.org/netdev/net/c/1a59c9c55585 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;
Add the missing mutex_unlock before return from function ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error handling case. Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- drivers/net/ethernet/mscc/ocelot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)