Thread (6 messages) flat view 6 messages, 3 authors, 5d ago

Re: [PATCH net] ieee802154: hwsim: free PIB after unregistering hardware

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2026-07-03 11:15:53
Also in: lkml, stable

Hello Yousef,
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help