Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13310122rwl; Wed, 4 Jan 2023 06:31:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXvNBYazE0rJrBZl+lDzEnuFcYBbZDhB2mwHEVZtfV3mrZz51m6woysC7zqXeHN30I2pRwZ/ X-Received: by 2002:a17:907:6d12:b0:7c1:79f5:9545 with SMTP id sa18-20020a1709076d1200b007c179f59545mr58550782ejc.42.1672842668068; Wed, 04 Jan 2023 06:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672842668; cv=none; d=google.com; s=arc-20160816; b=PBgJ8VXPSBdGhJl+iwWeQW8O2ODnUgTHYTdEFcTe8oRi5QKxVCR8HjLNIkxVE8Jrsf eiyxBHBf2SXcZXD5pA0qWJSolsdGVFVA+gWym8dqZXPX7pTtKhFVj8WUa2XtaZhBILZI Z2BBwCw4UPNrJ9UekMz0Yr1kOXZtuWJUEJwA6U7JAVe+dEvW0xfXNYq81KaOQNSkFywq r1KZT7TO6t7c1siXnrMh6X9vej1So0EotfGjulUOIIrP6+HzlnGOlhXf8d7fPGaA5t42 ArGdmVfDtRUfXSvG63GwMoLsb7w2h3tIqbGIoCmcf93lqmFy03+nIFwOThkOP9gpeGQ8 2ttw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eRdAe/J0ERfRUXr65auuxecC98gg1jv2HQ1cLpNGtk0=; b=TqG8NOtXMP2YInrA/LNhwCJcSXraW9FxDSDVzVj16kyzW+QHmqT7PSFgoHeMTOHfKO a04zgyYEm1bfe3h01kPh/6koEirru+CHRdntWJ5UxJN7YBaQSed60KlaIPWj1e8eqAAj 14dMLknPiCdkH4pq7likNNx7g09+5KUawlgj52K4ngiPHvD5MyYuIS3imjrvQp6j8nul 1m0uXDJIPyGxMeHosOCgL3iyn8WBqROlradE2lgFx2OH3Ce3Lpk1WsNTNyyOPen+I4+g 1OSiP5l1jB7gVioYuWVj4oL/6cDE7gGkOjsM4IDiumLezy727ESBHZeBtHXOfSywWS3c ie/g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe11-20020a170907318b00b007c122a58805si30297213ejb.727.2023.01.04.06.30.51; Wed, 04 Jan 2023 06:31:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237559AbjADOaU (ORCPT + 67 others); Wed, 4 Jan 2023 09:30:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239405AbjADOaB (ORCPT ); Wed, 4 Jan 2023 09:30:01 -0500 Received: from cstnet.cn (smtp80.cstnet.cn [159.226.251.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A93E33D9C8; Wed, 4 Jan 2023 06:29:40 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.125]) by APP-01 (Coremail) with SMTP id qwCowAD3_3P7i7VjaEnrCg--.12743S2; Wed, 04 Jan 2023 22:23:55 +0800 (CST) From: Jiasheng Jiang To: leon@kernel.org 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, Jiasheng Jiang Subject: [PATCH] wifi: rtw89: Add missing check for alloc_workqueue Date: Wed, 4 Jan 2023 22:23:53 +0800 Message-Id: <20230104142353.25093-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowAD3_3P7i7VjaEnrCg--.12743S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Cry8Aw4UCw45Wr1DGw1DGFg_yoW8Xr4fp3 yrAw1UAa15Jr1DCa92vw43CF15Wa1rtFW8u3s2gw1rXw15X34rGa4jga4Yvrn09FWvqFyY yFZ5XasxGrn5ZaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvC14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2 Y2ka0xkIwI1lc2xSY4AK67AK6ry5MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r 1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CE b7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0x vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAI cVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2Kf nxnUUI43ZEXa7VUjuWlDUUUUU== X-Originating-IP: [124.16.138.125] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 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. Anyway, I will submit a v2 that adds the missing destroy_workqueue. Thanks, Jiang