Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3060873rwb; Mon, 15 Aug 2022 17:09:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Pk1KUZgYereLMi/OWs56baqkigsSqEtPuizZaJBvc0QWBV2DTcgVzBijbMAheVzgMTZef X-Received: by 2002:a17:907:75e8:b0:730:ccd3:2683 with SMTP id jz8-20020a17090775e800b00730ccd32683mr11901334ejc.329.1660608585898; Mon, 15 Aug 2022 17:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660608585; cv=none; d=google.com; s=arc-20160816; b=josbugWclPPM8ivCnTgFaUY8skOx3xqNmgqWSiFJ5EwxSMDpHmlyeGMXlV9NtY+7n+ CgBCp7GdpKko0dmgF0cAYkn6GCZDy9flqbFxDu4Vlypx6XosNo5gskxPIr68gro7jOkQ RjkCF75L7i0TWx4OtOxbsDLRlvlH1+Y7o1IOHIHwsD8+r/Yv/fqJrHCk8F4ehvGFaZZI zJrgrZyBqTigd8LxZPv+x5mLMAPt/Nr1EbsUudfljyQewCCxkijdO/nr6S9DMmRBGA3j K/ydwo4pizB+ogtJZzL4JWpMOb9A/xC1tHjIOBnxbbJbEKUfCQrK2/X8Ivn4riP8vDI1 zM+A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j28WciEEctYtRawB5dmb3t5K0I6WKno7jTV1tQ9kz7Y=; b=So3hsTdiOYgG2NEhQxVnl/IRWbNCXscVoDStdnGGfmT5stRgmKZ4V3wT67qf6iV6lL UYPbi5FhK0wSnIPPxuKblXwKgoUiypXrjjgYXkmOrkCKybwpkhXLITYCwvs7TS57LrEr TK/FGr3am+E782xXfAtawRZ2x3aHJ40gNIg+BoNkM4mT26U62VvDF2QUa2Amg0UefwIt o0ns1eWW4vwX8acnvlgG0wopqFJk35iR8KLiFwwrtr1/8QqjMyd4rd7L+9EXBfxa4z+z 4wqFJVlp3LC9bQ4vb1cfKUAt8wehHmudiCNnEHpHvf+e/d2gjrCERO8CSDYveK1oQ2b8 2Neg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tXruzDut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd17-20020a1709069b9100b00730e5c46ed9si9445045ejc.15.2022.08.15.17.09.16; Mon, 15 Aug 2022 17:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=tXruzDut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351786AbiHPAFF (ORCPT + 99 others); Mon, 15 Aug 2022 20:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355558AbiHOX4j (ORCPT ); Mon, 15 Aug 2022 19:56:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9243616306E; Mon, 15 Aug 2022 13:19:57 -0700 (PDT) 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 2270761057; Mon, 15 Aug 2022 20:19:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 107EEC433D6; Mon, 15 Aug 2022 20:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594796; bh=UTztaEE8l6pZclggwKNlEFaJ8BgFSoAmWP/+gRernds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tXruzDutR4SktlMAfLpMR1VzOzpBonOVpXrNYT6uVWJaxtBWfIOUke3W/oARP/67P y/SHSnMKs/6aMfImriQCkyTxPZfB+I7lDsjh3Cew99iVtHYLt0rMg/9iGCZ+K/WLWH 6ikn9qo66pHbUDqVMufZs+4ZTUPMro4WxAMrlQYc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hacash Robot , William Dean , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 5.19 0562/1157] wifi: rtw88: check the return value of alloc_workqueue() Date: Mon, 15 Aug 2022 19:58:38 +0200 Message-Id: <20220815180502.085806225@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org From: William Dean [ Upstream commit 42bbf810e155efc6129a3a648ae5300f00b79d7b ] 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 Signed-off-by: William Dean Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220723063756.2956189-1-williamsukatube@163.com Signed-off-by: Sasha Levin --- 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.35.1