Re: [PATCH net] ieee802154: hwsim: free PIB after unregistering hardware
From: Miquel Raynal
Date: Fri Jul 03 2026 - 07:20:39 EST
Hello Yousef,
> @@ -1004,12 +1004,11 @@ static void hwsim_del(struct hwsim_phy *phy)
> list_del_rcu(&e->list);
> hwsim_free_edge(e);
> }
> - pib = rcu_dereference(phy->pib);
> rcu_read_unlock();
>
> - kfree_rcu(pib, rcu);
> -
> ieee802154_unregister_hw(phy->hw);
> + pib = rcu_dereference_protected(phy->pib, 1);
> + kfree_rcu(pib, rcu);
> ieee802154_free_hw(phy->hw);
> }
Would you mind justifying the choice for the _protected() version,
please?
Thanks,
Miquèl