WSL2-Linux-Kernel/drivers/net/wireless/realtek/rtl8xxxu
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
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rtl8xxxu.h rtl8xxxu: Fix the handling of TX A-MPDU aggregation 2021-08-21 21:17:20 +03:00
rtl8xxxu_8192c.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
rtl8xxxu_8192e.c rtl8xxxu: Fix device info for RTL8192EU devices 2021-06-19 12:05:40 +03:00
rtl8xxxu_8723a.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295 2019-06-05 17:36:38 +02:00
rtl8xxxu_8723b.c rtl8xxxu: fix RTL8723BU connection failure issue after warm reboot 2019-10-22 11:26:13 +03:00
rtl8xxxu_core.c wifi: rtl8xxxu: Fix the error handling of the probe function 2022-07-27 15:52:55 +03:00
rtl8xxxu_regs.h rtl8xxxu: Use lower tx rates for the ack packet 2021-10-05 08:33:05 +03:00