[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <303b6e26a6514b5485a3ca5286ae98c6@realtek.com>
Date: Tue, 26 Jul 2022 02:38:06 +0000
From: Ping-Ke Shih <pkshih@...ltek.com>
To: "williamsukatube@....com" <williamsukatube@....com>,
"tony0620emma@...il.com" <tony0620emma@...il.com>,
"kvalo@...nel.org" <kvalo@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: William Dean <williamsukatube@...il.com>,
Hacash Robot <hacashRobot@...tino.com>
Subject: RE: [PATCH] rtw88: check the return value of alloc_workqueue()
> -----Original Message-----
> From: williamsukatube@....com <williamsukatube@....com>
> Sent: Saturday, July 23, 2022 2:38 PM
> To: tony0620emma@...il.com; kvalo@...nel.org; davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; linux-wireless@...r.kernel.org; netdev@...r.kernel.org; linux-kernel@...r.kernel.org
> Cc: William Dean <williamsukatube@...il.com>; Hacash Robot <hacashRobot@...tino.com>
> Subject: [PATCH] rtw88: check the return value of alloc_workqueue()
>
> From: William Dean <williamsukatube@...il.com>
>
> 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@...tino.com>
> Signed-off-by: William Dean <williamsukatube@...il.com>
Reviewed-by: Ping-Ke Shih <pkshih@...ltek.com>
Thank you
> ---
> drivers/net/wireless/realtek/rtw88/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> index efabd5b1bf5b..645ef1d01895 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.c
> +++ b/drivers/net/wireless/realtek/rtw88/main.c
> @@ -1984,6 +1984,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);
> --
> 2.25.1
Powered by blists - more mailing lists