lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y7aTvDWQnHQfN3su@unreal>
Date:   Thu, 5 Jan 2023 11:09:16 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     pkshih@...ltek.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
Subject: Re: [PATCH] wifi: rtw89: Add missing check for alloc_workqueue

On Wed, Jan 04, 2023 at 10:23:53PM +0800, Jiasheng Jiang wrote:
> On Wed, Jan 04, 2023 at 07:41:36PM +0800, Leon Romanovsky wrote:
> > On Wed, Jan 04, 2023 at 05:33:53PM +0800, Jiasheng Jiang wrote:
> >> Add check for the return value of alloc_workqueue since it may return
> >> NULL pointer.
> >> 
> >> Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver")
> >> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> >> ---
> >>  drivers/net/wireless/realtek/rtw89/core.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >> 
> >> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> >> index 931aff8b5dc9..006fe0499f81 100644
> >> --- a/drivers/net/wireless/realtek/rtw89/core.c
> >> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> >> @@ -3124,6 +3124,8 @@ int rtw89_core_init(struct rtw89_dev *rtwdev)
> >>  	INIT_DELAYED_WORK(&rtwdev->cfo_track_work, rtw89_phy_cfo_track_work);
> >>  	INIT_DELAYED_WORK(&rtwdev->forbid_ba_work, rtw89_forbid_ba_work);
> >>  	rtwdev->txq_wq = alloc_workqueue("rtw89_tx_wq", WQ_UNBOUND | WQ_HIGHPRI, 0);
> >> +	if (!rtwdev->txq_wq)
> >> +		return -ENOMEM;
> > 
> > While the change is fixing one issue, you are adding another one.
> > There is no destroy of this workqueue if rtw89_load_firmware fails.
> 
> Actually, I do not think the missing of destroy_workqueue is introduced by me.
> Even without my patch, the destroy_workqueue is still missing.

Not really, without your change, rtw89_core_init() never failed.

> Anyway, I will submit a v2 that adds the missing destroy_workqueue.

Thanks

> 
> Thanks,
> Jiang
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ