Skip to content

Commit

Permalink
ieee802154: hwsim: fix missing unlock on error in hwsim_add_one()
Browse files Browse the repository at this point in the history
Add the missing unlock before return from function hwsim_add_one()
in the error handling case.

Fixes: f25da51 ("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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Aug 9, 2018
1 parent 470770b commit 13403d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ieee802154/mac802154_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13403d6

Please sign in to comment.