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

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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment