mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 02:00:43 -04:00
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 <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user