diff options
author | William Dean <williamsukatube@gmail.com> | 2022-07-23 08:37:56 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-07-29 15:35:53 +0200 |
commit | 42bbf810e155efc6129a3a648ae5300f00b79d7b (patch) | |
tree | fc5e1f54c90cace403ac4587430727d4b8156ea8 /drivers/net/wireless/realtek/rtw88/main.c | |
parent | wifi: rtw89: 8852a: adjust IMR for SER L1 (diff) | |
download | linux-42bbf810e155efc6129a3a648ae5300f00b79d7b.tar.xz linux-42bbf810e155efc6129a3a648ae5300f00b79d7b.zip |
wifi: rtw88: check the return value of alloc_workqueue()
The function alloc_workqueue() in rtw_core_init() can fail, but
there is no check of its return value. To fix this bug, its return value
should be checked with new error handling code.
Fixes: fe101716c7c9d ("rtw88: replace tx tasklet with work queue")
Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: William Dean <williamsukatube@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220723063756.2956189-1-williamsukatube@163.com
Diffstat (limited to '')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 985ee36efc0f..76dc9da88f6c 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -1992,6 +1992,10 @@ int rtw_core_init(struct rtw_dev *rtwdev) timer_setup(&rtwdev->tx_report.purge_timer, rtw_tx_report_purge_timer, 0); rtwdev->tx_wq = alloc_workqueue("rtw_tx_wq", WQ_UNBOUND | WQ_HIGHPRI, 0); + if (!rtwdev->tx_wq) { + rtw_warn(rtwdev, "alloc_workqueue rtw_tx_wq failed\n"); + return -ENOMEM; + } INIT_DELAYED_WORK(&rtwdev->watch_dog_work, rtw_watch_dog_work); INIT_DELAYED_WORK(&coex->bt_relink_work, rtw_coex_bt_relink_work); |