[PATCH] ath11k: add ieee80211_unregister_hw to avoid kernel crash caused by NULL pointer

Kalle Valo kvalo at codeaurora.org
Mon Jan 18 11:38:17 EST 2021


Wen Gong <wgong at codeaurora.org> 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



More information about the ath11k mailing list