[PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()

Subsystems: networking drivers, ocelot ethernet switch driver, the rest

STALE1713d LANDED

Landed in mainline as 1a59c9c55585 on 2021-11-30.

3 messages, 3 authors, 2021-11-30 · open the first message on its own page

[PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()

From: Wei Yongjun <hidden>
Date: 2021-11-29 15:05:56

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 <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/ethernet/mscc/ocelot.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
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;

Re: [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-11-29 15:19:07

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 <redacted>
Signed-off-by: Wei Yongjun <redacted>
---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Re: [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-30 04:30:14

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:

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 <redacted>
Signed-off-by: Wei Yongjun <redacted>

[...]
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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help