Skip to content

Commit 3220712

Browse files
khoroshilovlinvjw
authored andcommitted
mwifiex: don't return zero on failure paths in mwifiex_pcie_init()
If pci_iomap() fails in mwifiex_pcie_init(), it breaks off initialization, deallocates all resources, but returns zero. The patch adds -EIO as return value in this case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent baf58b0 commit 3220712

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/net/wireless/mwifiex

‎drivers/net/wireless/mwifiex/pcie.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
19851985
card->pci_mmap = pci_iomap(pdev, 0, 0);
19861986
if (!card->pci_mmap) {
19871987
dev_err(adapter->dev, "iomap(0) error\n");
1988+
ret = -EIO;
19881989
goto err_iomap0;
19891990
}
19901991
ret = pci_request_region(pdev, 2, DRV_NAME);
@@ -1995,6 +1996,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
19951996
card->pci_mmap1 = pci_iomap(pdev, 2, 0);
19961997
if (!card->pci_mmap1) {
19971998
dev_err(adapter->dev, "iomap(2) error\n");
1999+
ret = -EIO;
19982000
goto err_iomap2;
19992001
}
20002002

0 commit comments

Comments
 (0)