Commit 9c32950f authored by Lv Ruyi's avatar Lv Ruyi Committed by David S. Miller
Browse files

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: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0190879
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;