[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230418073858.36507-1-u202112078@hust.edu.cn>
Date: Tue, 18 Apr 2023 15:38:57 +0800
From: Ruting Zhang <u202112078@...t.edu.cn>
To: M Chetan Kumar <m.chetan.kumar@...el.com>,
Intel Corporation <linuxwwan@...el.com>,
Loic Poulain <loic.poulain@...aro.org>,
Sergey Ryazanov <ryazanov.s.a@...il.com>,
Johannes Berg <johannes@...solutions.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: hust-os-kernel-patches@...glegroups.com,
Ruting Zhang <u202112078@...t.edu.cn>,
Dongliang Mu <dzm91@...t.edu.cn>,
M Chetan Kumar <m.chetan.kumar@...ux.intel.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] net: wwan: iosm: fix a resource leak in probe
drivers/net/wwan/iosm/iosm_ipc_pcie.c:298 ipc_pcie_probe() Smatch warn:
missing unwind goto?
There is a resource leak in this place.
Fix it by changing "return ret" into "goto resources_req_fail".
Fixes: 035e3befc191 ("net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled")
Signed-off-by: Ruting Zhang <u202112078@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
The issue is found by static analysis and remains untested.
---
drivers/net/wwan/iosm/iosm_ipc_pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
index 5bf5a93937c9..33339e8af1dc 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_pcie.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
@@ -295,7 +295,7 @@ static int ipc_pcie_probe(struct pci_dev *pci,
ret = dma_set_mask(ipc_pcie->dev, DMA_BIT_MASK(64));
if (ret) {
dev_err(ipc_pcie->dev, "Could not set PCI DMA mask: %d", ret);
- return ret;
+ goto resources_req_fail;
}
ipc_pcie_config_aspm(ipc_pcie);
--
2.34.1
Powered by blists - more mailing lists