Skip to content

Commit 1a59c9c

Browse files
Wei Yongjunkuba-moo
authored andcommitted
net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()
Add the missing mutex_unlock before return from function ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error handling case. Fixes: 96ca08c ("net: mscc: ocelot: set up traps for PTP packets") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5fdc233 commit 1a59c9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,10 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
15631563
}
15641564

15651565
err = ocelot_setup_ptp_traps(ocelot, port, l2, l4);
1566-
if (err)
1566+
if (err) {
1567+
mutex_unlock(&ocelot->ptp_lock);
15671568
return err;
1569+
}
15681570

15691571
if (l2 && l4)
15701572
cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;

0 commit comments

Comments
 (0)