lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230408065607.1633970-1-harshit.m.mogalapalli@oracle.com>
Date:   Fri,  7 Apr 2023 23:56:07 -0700
From:   Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To:     m.chetan.kumar@...el.com, linuxwwan@...el.com,
        loic.poulain@...aro.org, ryazanov.s.a@...il.com,
        johannes@...solutions.net
Cc:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, error27@...il.com,
        simon.horman@...igine.com, kernel-janitors@...r.kernel.org,
        vegard.nossum@...cle.com,
        Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
Subject: [PATCH net] net: wwan: iosm: Fix error handling path in ipc_pcie_probe()

Smatch reports:
	drivers/net/wwan/iosm/iosm_ipc_pcie.c:298 ipc_pcie_probe()
	warn: missing unwind goto?

When dma_set_mask fails it directly returns without disabling pci
device and freeing ipc_pcie. Fix this my calling a correct goto label

As dma_set_mask returns either 0 or -EIO, we can use a goto label, as
it finally returns -EIO.

Renamed the goto label as name of the label before this patch is not
relevant after this patch.

Fixes: 035e3befc191 ("net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
---
This is based on static analysis, only compile tested.
---
 drivers/net/wwan/iosm/iosm_ipc_pcie.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_pcie.c b/drivers/net/wwan/iosm/iosm_ipc_pcie.c
index 5bf5a93937c9..a6a6a0df1f7d 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 err_disable_pci;
 	}
 
 	ipc_pcie_config_aspm(ipc_pcie);
@@ -308,7 +308,7 @@ static int ipc_pcie_probe(struct pci_dev *pci,
 	ipc_pcie->suspend = 0;
 
 	if (ipc_pcie_resources_request(ipc_pcie))
-		goto resources_req_fail;
+		goto err_disable_pci;
 
 	/* Establish the link to the imem layer. */
 	ipc_pcie->imem = ipc_imem_init(ipc_pcie, pci->device,
@@ -322,7 +322,7 @@ static int ipc_pcie_probe(struct pci_dev *pci,
 
 imem_init_fail:
 	ipc_pcie_resources_release(ipc_pcie);
-resources_req_fail:
+err_disable_pci:
 	pci_disable_device(pci);
 pci_enable_fail:
 	kfree(ipc_pcie);
-- 
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ