diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index 08dd521a51a5..6771c0569516 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h @@ -101,6 +101,7 @@ enum { enum ieee802154_sdata_state_bits { SDATA_STATE_RUNNING, + SDATA_STATE_LISTDONE, }; /* Slave interface definition. diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index c0e2da5072be..95f11d377fd3 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -683,6 +683,10 @@ void ieee802154_if_remove(struct ieee802154_sub_if_data *sdata) { ASSERT_RTNL(); + printk("sd: %p, sdl: %p, dev: %p, l: %p, if remove\n", sdata, sdata->list, sdata->dev, sdata->local); + if (test_bit(SDATA_STATE_LISTDONE, &sdata->state)) + return; + mutex_lock(&sdata->local->iflist_mtx); list_del_rcu(&sdata->list); mutex_unlock(&sdata->local->iflist_mtx); @@ -697,7 +701,9 @@ void ieee802154_remove_interfaces(struct ieee802154_local *local) mutex_lock(&local->iflist_mtx); list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { + printk("sd: %p, sdl: %p, dev: %p, l: %p, rmv interfaces\n", sdata, sdata->list, sdata->dev, sdata->local); list_del(&sdata->list); + set_bit(SDATA_STATE_LISTDONE, &sdata->state); unregister_netdevice(sdata->dev); } diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 21b7c3b280b4..81289719584e 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c @@ -279,6 +279,7 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw) rtnl_lock(); + printk("l: %p unreg hw\n", local); ieee802154_remove_interfaces(local); rtnl_unlock();