提交 1a59c9c5 编写于 作者: W Wei Yongjun 提交者: Jakub Kicinski

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: 96ca08c0 ("net: mscc: ocelot: set up traps for PTP packets")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NVladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20211129151652.1165433-1-weiyongjun1@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 5fdc2333
......@@ -1563,8 +1563,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册