linux/drivers/staging
Nam Cao 86b818e249 staging: rtl8712: fix race condition
commit 1422b526fb upstream.

In probe function, request_firmware_nowait() is called to load firmware
asynchronously. At completion of firmware loading, register_netdev() is
called. However, a mutex needed by netdev is initialized after the call
to request_firmware_nowait(). Consequently, it can happen that
register_netdev() is called before the driver is ready.

Move the mutex initialization into r8712_init_drv_sw(), which is called
before request_firmware_nowait().

Reported-by: syzbot+b08315e8cf5a78eed03c@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-staging/000000000000d9d4560601b8e0d7@google.com/T/#u
Fixes: 8c213fa591 ("staging: r8712u: Use asynchronous firmware loading")
Cc: stable <stable@kernel.org>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/20230731110620.116562-1-namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-09-06 21:27:01 +01:00
..
axis-fifo staging: axis-fifo: initialize timeouts in init only 2023-05-24 17:32:40 +01:00
board staging: board: Fix uninitialized spinlock when attaching genpd 2021-07-21 11:22:15 +02:00
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-03-11 13:55:34 +01:00
fbtft staging: fbtft: core: set smem_len before fb_deferred_io_init call 2022-07-28 10:42:42 +02:00
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-04-22 16:48:31 +02:00
gdm724x staging: gdm724x: drop unused CDC defines 2022-07-25 10:57:42 +02:00
greybus Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
iio staging: iio: resolver: ads1210: fix config mode 2023-05-11 23:03:01 +09:00
ks7010 staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext() 2023-08-03 10:24:12 +02:00
media media: staging: atomisp: select V4L2_FWNODE 2023-08-03 10:23:57 +02:00
most i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
nvec Staging: nvec: Fix ending in '(' error 2022-02-08 10:46:01 +01:00
octeon staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow 2022-09-24 13:07:31 +02:00
olpc_dcon i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
pi433 staging: pi433: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:36 +01:00
qlge net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
r8188eu drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler 2022-12-31 13:32:38 +01:00
rtl8192e Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE" 2023-06-14 11:15:34 +02:00
rtl8192u staging: rtl8192u: Fix use after free in ieee80211_rx() 2022-12-31 13:32:42 +01:00
rtl8712 staging: rtl8712: fix race condition 2023-09-06 21:27:01 +01:00
rtl8723bs drivers: staging: rtl8723bs: Fix locking in rtw_scan_timeout_handler() 2023-05-11 23:03:27 +09:00
rts5208 staging: rts5208: spi.c: fix codestyle error in dynamic debug code 2022-06-06 07:53:49 +02:00
sm750fb Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
vc04_services staging: vchiq_arm: mark vchiq_platform_init() static 2023-07-19 16:21:52 +02:00
vme_user vme: Fix error not catched in fake_init() 2022-12-31 13:32:42 +01:00
vt6655 staging: vt6655: fix some erroneous memory clean-up loops 2022-09-24 13:05:24 +02:00
vt6656 wifi: mac80211: return a beacon for a specific link 2022-06-20 12:57:08 +02:00
wlan-ng Staging driver changes for 6.1-rc1 2022-10-08 09:19:24 -07:00
Kconfig Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
Makefile Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00