Commit 13403d69 authored by Wei Yongjun's avatar Wei Yongjun Committed by 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: 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
......@@ -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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment