static void fakelb_del(struct fakelb_phy *phy)
{
- write_lock_bh(&fakelb_lock);
list_del(&phy->list);
- write_unlock_bh(&fakelb_lock);
ieee802154_unregister_hw(phy->hw);
ieee802154_free_hw(phy->hw);
return 0;
err_slave:
+ write_lock_bh(&fakelb_lock);
list_for_each_entry_safe(phy, tmp, &fakelb_phys, list)
fakelb_del(phy);
+ write_unlock_bh(&fakelb_lock);
return err;
}
{
struct fakelb_phy *phy, *temp;
+ write_lock_bh(&fakelb_lock);
list_for_each_entry_safe(phy, temp, &fakelb_phys, list)
fakelb_del(phy);
-
+ write_unlock_bh(&fakelb_lock);
return 0;
}