wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice()
authorAjay Singh <ajay.kathat@microchip.com>
Wed, 4 May 2022 16:19:26 +0000 (16:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:56 +0000 (10:22 +0200)
commit7fef8ec5b1d881dafb1c97547cff4b3bf523fb96
treeb20ac5bb7262abbd2214c272caffd145d5e46a44
parent1eb4f56f8ff9ea6aa31bb799de7b9b36295b7637
wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice()

[ Upstream commit 868f0e28290c7a33e8cb79bfe97ebdcbb756e048 ]

Monitor(mon.) interface is used for handling the AP mode and 'ieee80211_ptr'
reference is not getting set for it. Like earlier implementation,
use register_netdevice() instead of cfg80211_register_netdevice() which
expects valid 'ieee80211_ptr' reference to avoid the possible crash.

Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics")
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220504161924.2146601-3-ajay.kathat@microchip.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/microchip/wilc1000/mon.c