Add the missing unlock before return from function hwsim_add_one()
in the error handling case.
Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Stefan Schmidt <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
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);