mirror_ubuntu-kernels/drivers/net/wireless/realtek
Zheyu Ma 13876f2a08 wifi: rtl8xxxu: Fix the error handling of the probe function
When the driver fails at ieee80211_alloc_hw() at the probe time, the
driver will free the 'hw' which is not allocated, causing a bug.

The following log can reveal it:

[   15.981294] BUG: KASAN: user-memory-access in mutex_is_locked+0xe/0x40
[   15.981558] Read of size 8 at addr 0000000000001ab0 by task modprobe/373
[   15.982583] Call Trace:
[   15.984282]  ieee80211_free_hw+0x22/0x390
[   15.984446]  rtl8xxxu_probe+0x3a1/0xab30 [rtl8xxxu]

Fix the bug by changing the order of the error handling.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220716130444.2950690-1-zheyuma97@gmail.com
2022-07-27 15:52:55 +03:00
..
rtl8xxxu wifi: rtl8xxxu: Fix the error handling of the probe function 2022-07-27 15:52:55 +03:00
rtl818x wifi: mac80211: change QoS settings API to take link into account 2022-07-15 11:43:15 +02:00
rtlwifi wifi: rtlwifi: Remove duplicate word and Fix typo 2022-07-27 14:05:39 +03:00
rtw88 wifi: mac80211: replace link_id with link_conf in start/stop_ap() 2022-07-15 11:43:17 +02:00
rtw89 wifi: mac80211: replace link_id with link_conf in start/stop_ap() 2022-07-15 11:43:17 +02:00
Kconfig rtw89: add Realtek 802.11ax driver 2021-10-13 09:01:12 +03:00
Makefile rtw89: add Realtek 802.11ax driver 2021-10-13 09:01:12 +03:00