diff options
Diffstat (limited to 'drivers/net/ieee802154/mac802154_hwsim.c')
-rw-r--r-- | drivers/net/ieee802154/mac802154_hwsim.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c index 9319780a52ca..07a493dea11e 100644 --- a/drivers/net/ieee802154/mac802154_hwsim.c +++ b/drivers/net/ieee802154/mac802154_hwsim.c @@ -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); |