Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13403d69 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 470770bf
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -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);