Skip to content

Commit 9c32950

Browse files
Lv Ruyidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Lv Ruyi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c019087 commit 9c32950

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
@@ -1651,8 +1651,10 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
16511651
}
16521652

16531653
err = ocelot_setup_ptp_traps(ocelot, port, l2, l4);
1654-
if (err)
1654+
if (err) {
1655+
mutex_unlock(&ocelot->ptp_lock);
16551656
return err;
1657+
}
16561658

16571659
if (l2 && l4)
16581660
cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;

0 commit comments

Comments
 (0)