From patchwork Mon Apr 17 11:59:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Ningke X-Patchwork-Id: 675027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DD5FC77B72 for ; Mon, 17 Apr 2023 12:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjDQMMz (ORCPT ); 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 X-FEAS-AUTH-USER: lnk_01@hust.edu.cn 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: