Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp70797rwd; Tue, 6 Jun 2023 18:42:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HL0Vd3Yu+X3lY4fW7OL9QN6CRrd8Qx7FDSDfqgO2EaZXD4I/zLrUtRhEfdLyJ/uJxlDz6 X-Received: by 2002:a05:6808:a8a:b0:383:ca99:c70e with SMTP id q10-20020a0568080a8a00b00383ca99c70emr3725222oij.59.1686102139163; Tue, 06 Jun 2023 18:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686102139; cv=none; d=google.com; s=arc-20160816; b=JEFi9f7I6HOPVnwOB9ZJL6NAz+8cGYzBqThXyFm79HL8P1wy/57BnR40U97uYP+olp 0sJ1jJuLoO0T8QqmaOD9gDjJHnIZKAaf8gux1917DCZ8GvgWYXzzG8VSOJ3lvTC2oiNw gdhOerp1VfsmZ3LNBrAthogjciwobxb/gXXv0wbZVHkUlIFZPK8vWf9Dw7irtC3N20o5 EtYQ1ADdmrF/Mdtzq4s3fdNVSF5bYUG3Y+2Ht41LnSZcilUgd7hAXbvFXsGkr3Q4bFks 1wKLM1ltYXktVScbHlO8RY0b1ofHwWo7Iv767FGCV4P2r6wP1jgfS7tPOKf4GqQYle5l i5hQ== 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:authenticated-by; bh=lz+6/txL6IwylVQ+YUGbLng+X+hMzmAc6jUhCSrKgEo=; b=g2BKYSYnwIFWp82LQxsCh8YioSyOigKK+Rqs7cPj+8opONRG/ZmrFIHaK7TS56re5X dnrUmRFIDu0OBLr7Rh81lrHW+aKQtMq9+hFbKWCuY0wezNBPmYa1Szp1tp2Nui+kn2yz pKk7MLfB294RPJWP/2RKXoPFIEIcNwtlmgxoq7JS1TgxXULxsgUROUD2CuSZybAibZMM DZdIogR7kEgapAB0voSSgrO/OelON2bNUkQg8tV/kBxX9I7UMsLbS2nhBmepQ3DbP6DL BvOPlXEINg3xPpjoBGK4drE9laHQnmX06HWZ60cz63Hwt0487a3D2MQlzeJg/sHZunA7 shpg== 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 q4-20020a170902bd8400b001ae788e1660si7765777pls.441.2023.06.06.18.42.07; Tue, 06 Jun 2023 18:42:19 -0700 (PDT) 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 S240084AbjFGB2X (ORCPT + 62 others); Tue, 6 Jun 2023 21:28:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234753AbjFGB2V (ORCPT ); Tue, 6 Jun 2023 21:28:21 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C021981 for ; Tue, 6 Jun 2023 18:28:20 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3571Ri972004339, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3571Ri972004339 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Wed, 7 Jun 2023 09:27:44 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Wed, 7 Jun 2023 09:28:00 +0800 Received: from [127.0.1.1] (172.21.69.188) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Wed, 7 Jun 2023 09:28:00 +0800 From: Ping-Ke Shih To: , CC: , , , Subject: [PATCH] wifi: rtw88: add missing unwind goto for __rtw_download_firmware() Date: Wed, 7 Jun 2023 09:27:41 +0800 Message-ID: <20230607012741.10353-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.188] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-wireless@vger.kernel.org This flaw is detected by smatch: drivers/net/wireless/realtek/rtw88/mac.c:748 __rtw_download_firmware() warn: missing unwind goto? Though most things of dlfw_fail have been done by download_firmware_end_flow() and wlan_cpu_enable(), an exception is that download_firmware_end_flow() clear BIT_MCUFWDL_EN bit conditionally. So, make this change to clear the bit. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202306052310.OVhcUjZ3-lkp@intel.com/ Cc: Sascha Hauer Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c index a168f36c38ece..298663b035808 100644 --- a/drivers/net/wireless/realtek/rtw88/mac.c +++ b/drivers/net/wireless/realtek/rtw88/mac.c @@ -794,8 +794,10 @@ static int __rtw_download_firmware(struct rtw_dev *rtwdev, wlan_cpu_enable(rtwdev, true); - if (!ltecoex_reg_write(rtwdev, 0x38, ltecoex_bckp)) - return -EBUSY; + if (!ltecoex_reg_write(rtwdev, 0x38, ltecoex_bckp)) { + ret = -EBUSY; + goto dlfw_fail; + } ret = download_firmware_validate(rtwdev); if (ret) -- 2.25.1