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: f25da51fdc ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
470770bf84
commit
13403d6952
@@ -817,9 +817,11 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
|
|||||||
mutex_lock(&hwsim_phys_lock);
|
mutex_lock(&hwsim_phys_lock);
|
||||||
if (init) {
|
if (init) {
|
||||||
err = hwsim_subscribe_all_others(phy);
|
err = hwsim_subscribe_all_others(phy);
|
||||||
if (err < 0)
|
if (err < 0) {
|
||||||
|
mutex_unlock(&hwsim_phys_lock);
|
||||||
goto err_reg;
|
goto err_reg;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
list_add_tail(&phy->list, &hwsim_phys);
|
list_add_tail(&phy->list, &hwsim_phys);
|
||||||
mutex_unlock(&hwsim_phys_lock);
|
mutex_unlock(&hwsim_phys_lock);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user