From: Ondrej Jirman <megi@xxxxxx> This is a series of patches requested by Ping-Ke Shih in response to https://lore.kernel.org/lkml/20250427002414.410791-1-megi@xxxxxx/ Please take a look. (hw->wiphy->bands[*] are no longer being NULLed when probe fails and on remove(), but I guess that should not be an issue? I tried unbinding the device and it worked fine without any crash) thank you and regards, Ondrej Jirman Changes since v1: - added patch to convert some memory allocations to be devm_* managed - check for NULL from kmemdup() - rename rtw89_copy_sband - drop some kfree due to them not being needed because failed rtw89_core_set_supported_band() results in abandoned probe() and devm_* will take care of that - add error return to rtw89_init_he_eht_cap and check for it Ondrej Jirman (2): wifi: rtw89: Convert rtw89_core_set_supported_band to use devm_* wifi: rtw89: Fix inadverent sharing of struct ieee80211_supported_band data drivers/net/wireless/realtek/rtw89/core.c | 124 +++++++++++----------- 1 file changed, 60 insertions(+), 64 deletions(-) -- 2.49.0