Re: [PATCH] wifi: mac80211_hwsim: remove radios from rhashtable before freeing

From: Cen Zhang

Date: Mon Jul 06 2026 - 08:20:05 EST


Hi Johannes,

> How does the init even fail? I think this is fairly contrived,
> especially in a test tool. The whole thing is maybe worth a cleanup, but
> the whole scary commit message is nonsense.
>
> johannes

Thanks for your review.

The init failure I had in mind is a late one after radios have already
been created and inserted into hwsim_radios_rht, for example in the
monitor netdev setup after the radio loop. My local validation used
fault injection at dev_alloc_name() plus a bounded debug delay to make
that unwind window observable.

That means the test shows the cleanup ordering issue, but it is indeed
contrived, especially for mac80211_hwsim. The changelog I sent made this
sound much scarier than it should have, and including the long KASAN
report was not helpful.

The actual change I wanted is just the small consistency cleanup:
mac80211_hwsim_free() should remove data->rht before freeing the radio,
like the other radio removal paths already do.

Best regards,
Cen Zhang