Re: [PATCH] ath11k: add ieee80211_unregister_hw to avoid kernel crash caused by NULL pointer
From: Kalle Valo <hidden>
Date: 2021-01-18 16:38:31
Also in:
ath11k
From: Kalle Valo <hidden>
Date: 2021-01-18 16:38:31
Also in:
ath11k
Wen Gong [off-list ref] writes:
When function return fail to __ath11k_mac_register after success called ieee80211_register_hw, then it set wiphy->dev.parent to NULL by SET_IEEE80211_DEV(ar->hw, NULL) in end of __ath11k_mac_register, then cfg80211_get_drvinfo will be called by below call stack, but the wiphy->dev.parent is NULL, so kernel crash.
[...]
+err_unregister_hw: + ieee80211_unregister_hw(ar->hw); + err_free_if_combs: kfree(ar->hw->wiphy->iface_combinations[0].limits); kfree(ar->hw->wiphy->iface_combinations);
Incorrect indentation, I'm surprised checkpatch doesn't catch that. But fixed this in the pending branch. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches