提交 13403d69 编写于 作者: W Wei Yongjun 提交者: David S. Miller

ieee802154: hwsim: fix missing unlock on error in hwsim_add_one()

Add the missing unlock before return from function hwsim_add_one()
in the error handling case.

Fixes: f25da51f ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 470770bf
......@@ -817,8 +817,10 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
mutex_lock(&hwsim_phys_lock);
if (init) {
err = hwsim_subscribe_all_others(phy);
if (err < 0)
if (err < 0) {
mutex_unlock(&hwsim_phys_lock);
goto err_reg;
}
}
list_add_tail(&phy->list, &hwsim_phys);
mutex_unlock(&hwsim_phys_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册