Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Add a set_mask_fail goto label which stands consistent with other goto
labels in this function..

Fixes: 035e3befc191 ("net: wwan: iosm: fix driver not working with INTEL_IOMMU disabled")
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Harshit Mogalapalli and committed by
David S. Miller
a56ef256 9744d2bf

+2 -1
+2 -1
drivers/net/wwan/iosm/iosm_ipc_pcie.c
··· 295 295 ret = dma_set_mask(ipc_pcie->dev, DMA_BIT_MASK(64)); 296 296 if (ret) { 297 297 dev_err(ipc_pcie->dev, "Could not set PCI DMA mask: %d", ret); 298 - return ret; 298 + goto set_mask_fail; 299 299 } 300 300 301 301 ipc_pcie_config_aspm(ipc_pcie); ··· 323 323 imem_init_fail: 324 324 ipc_pcie_resources_release(ipc_pcie); 325 325 resources_req_fail: 326 + set_mask_fail: 326 327 pci_disable_device(pci); 327 328 pci_enable_fail: 328 329 kfree(ipc_pcie);