Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp580542rwl; Thu, 5 Jan 2023 01:21:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzm3eFQ66gSBkbIA08iPrKGFDp8iHadVFsYtY2ZgdImGJhpTR5hApvK6wRs3Ds8jKQS4bi X-Received: by 2002:a05:6a20:94c3:b0:ad:f155:7b5b with SMTP id ht3-20020a056a2094c300b000adf1557b5bmr72169824pzb.13.1672910508928; Thu, 05 Jan 2023 01:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672910508; cv=none; d=google.com; s=arc-20160816; b=R+1Wgne3+ABckUawpfc1Q789ZzCW2e7iYoaWjxpU6XpNC3YT/hdKjWnECL/1VWXECD mxdIPLsFIqwraadGLYoGnLaAcYBpBhCJ0AAz8JBW8t3OaKz7eueyJldcDUb3SFqtX2cl IEgGiM5blt98GKXp9SkJtqOPo3akUaU8AQlGNokSzLUoCbVMRAcACS5/mXX3IlpHvYWa 1c0DDYke3PaKM8v3eDc39oeJemPnoZ80AXvb4j8vhgm8OBr/z9Zu/YWODhXjysmpGo7a GGy5lL9qn5oISIm0Y1LJn2sgCWT93aO4QjWUzgkGtJrbt+PZXMKzOVmlAfVMGt57eJgq iDUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3UreKvfs2APSKVBDMmP3AeLfHu2FibrkLnpvtMLFu2k=; b=cne+HrTmYU31H5Iav7sxCI5hahFXed9JGBWwdsxqClBB9lUeE1N4oND2KaiKDkiX5b KHnNyOKtCLRuUgatn/9S/jdr2Q7pVjY2M4li5N3xUJOxIn6HLUFZe/ipDCLCrktzt+3j kviwBwAc2KMYNy6pwaJhPgBc7DeN4qsYn5ZFQD3l2JgDZl3evRKiHw4IToDQXad13LnU 0ygXSb2pN1hLQVSXyeV7Rve1QcD+VR/GsRbUba8zX/v2UugUw2mC15JbX9r03gzQOCGG pD2d3qNlWHPP61ofIj0w7q0gBeB3brvw1rSxmGU75rFZ5Qw4FgL2i/lH6yUedawAJvMh 38lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Txu4a/n2"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u24-20020a656718000000b004705618bd69si38905660pgf.343.2023.01.05.01.21.37; Thu, 05 Jan 2023 01:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Txu4a/n2"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231712AbjAEJJr (ORCPT + 66 others); Thu, 5 Jan 2023 04:09:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbjAEJJW (ORCPT ); Thu, 5 Jan 2023 04:09:22 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6997C5017D; Thu, 5 Jan 2023 01:09:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0905E61929; Thu, 5 Jan 2023 09:09:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F44C433D2; Thu, 5 Jan 2023 09:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672909760; bh=Br5C/uDEZK1Yfd+HJpl97NIZZHEqGbxQ5YfknJjVjAU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Txu4a/n2IHl5nt5WRP3pqB7IP4KyrZNf0l0ncRjbTsjYiQkIFxjMcPK4wNOXch7L3 yb6QtPrpGTg8QyWHDg2p2MGW+1dyxXejtSCJ0wKCGV09mHXSzLQeuBPF2m/FEoYBWf MUwYMLp7EuLk+C7cE+ikg8VWLytjHOTHWVtVB2LozF5cN/oEevADVB+2jEOP+LLEAN vz2uZ1shdVpSazzRSv+CCunu4VqzwKekxQjclZQuuMOhfmWngiN/yJ0lHL0m/BMNe7 sTb0R8VhZWNsO9ZnFzSdPGRX9ohZ8zR2H/i4Zg3EM43BMeB/279TKc1mxYrHiQ6m83 bd2sX4vJXW3kg== Date: Thu, 5 Jan 2023 11:09:16 +0200 From: Leon Romanovsky To: Jiasheng Jiang Cc: pkshih@realtek.com, kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] wifi: rtw89: Add missing check for alloc_workqueue Message-ID: References: <20230104142353.25093-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230104142353.25093-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 > >> --- > >> 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 >