Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3891018rwe; Mon, 17 Apr 2023 05:15:12 -0700 (PDT) X-Google-Smtp-Source: AKy350b9qiUOdDMJ9vk1WKuu9fFAcQCDmQE5rVp1PIDYdwYYVY+mnFoSfmYZ3FfwnFeH9/VpGlIq X-Received: by 2002:a17:90b:198:b0:23d:500f:e826 with SMTP id t24-20020a17090b019800b0023d500fe826mr15209320pjs.14.1681733712117; Mon, 17 Apr 2023 05:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681733712; cv=none; d=google.com; s=arc-20160816; b=Nu6GnZxf93IQNoGrl1XXNDqAxqAZmM2XGu1hBjeL3SXw9sHtKKhcfdFqd1qQYBv+/7 AqJ7sBXYEfjWlo7JRGSG+o3rCJvIIj2N3D47yUC1px5cvlJtB8Q4SNY1mDDoBQsrsM+K DVr1sbSY3t5H0QWFbqhNc7Tl2XhRftfo+bu8wv/2J2Sf8eRf5bjb4KGWIqLN0nbUZK7F P6+ad5YleII/w6exHQ3m+9b5Yv/lqFulfwqu0NW/xPAkOSE73V38YZLjKH2sfMt519SI i+WQ66PbPM+Vyxi//FQf7qYSZO8Ywj+GUbOFMLeWZOw+G8tHUjSLFFZT/kzgafe2n+db Nc2Q== 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=qCK9LHgQ5cvmWFIXqwqskR3wrkDe+nAJ8qnlX7nuXFY=; b=kHgU9EMvGmEBOhs4xsAyml9jhUPNQkeDe80O9gnxSMB6AwAgLuR+D72QUJOlBN4vCh PJ5KXa7C5/nQxDtGXgT+NVzIT9KggXuGLmSnJu+eITAOs/rW25w24d5ROV4BvKJe+YCT 6XwJVFrrCVF7oUqVNIMauGxuJoMYpxtrQLC2SJZArwe+u/SAUIEy8bcjtdmwweC/Fnse A/1dOglCeFqcwjWJY6cjH2G/uz2cibnSVhVXqpYf6pHHBslLvSYYXONYsgo8Ou+wOyvd gDisRse2kzJMU/sw77HPO1X/TPc0cDFWgwaJ8lLEWq+7m3R7oNF0uhoGO3+EgR4zVwKG CwXQ== 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 d16-20020a17090abf9000b0024765bb4f7esi5315436pjs.25.2023.04.17.05.15.00; Mon, 17 Apr 2023 05:15:12 -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 S230440AbjDQMMz (ORCPT + 63 others); Mon, 17 Apr 2023 08:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjDQMMx (ORCPT ); Mon, 17 Apr 2023 08:12:53 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 693A47296; Mon, 17 Apr 2023 05:12:20 -0700 (PDT) Received: from lnk.. ([10.12.190.56]) (user=lnk_01@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33HC06ws003063-33HC06wt003063 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Apr 2023 20:00:10 +0800 From: Li Ningke To: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vasanthakumar Thiagarajan , Jeff Johnson , Karthikeyan Periyasamy , Carl Huang , P Praneesh Cc: hust-os-kernel-patches@googlegroups.com, Li Ningke , Dongliang Mu , Kalle Valo , Bhagavathi Perumal S , Baochen Qiang , Balamurugan Selvarajan , ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] wifi: ath12k: fix missing unwind goto in `ath12k_pci_probe` Date: Mon, 17 Apr 2023 11:59:21 +0000 Message-Id: <20230417115921.176229-1-lnk_01@hust.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: lnk_01@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 Smatch complains that drivers/net/wireless/ath/ath12k/pci.c:1198 ath12k_pci_probe() warn: missing unwind goto? In order to release the allocated resources before returning an error, the statement that directly returns the error is changed to a goto statement that first releases the resources in the error handling section. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Li Ningke Reviewed-by: Dongliang Mu --- The issue is found by static analysis and the patch remains untested. --- drivers/net/wireless/ath/ath12k/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index ae7f6083c9fc..f523aa15885f 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1195,7 +1195,8 @@ static int ath12k_pci_probe(struct pci_dev *pdev, dev_err(&pdev->dev, "Unknown hardware version found for QCN9274: 0x%x\n", soc_hw_version_major); - return -EOPNOTSUPP; + ret = -EOPNOTSUPP; + goto err_pci_free_region; } break; case WCN7850_DEVICE_ID: -- 2.34.1