Commit 3220712d authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by John W. Linville

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent baf58b0e
...@@ -1985,6 +1985,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter) ...@@ -1985,6 +1985,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
card->pci_mmap = pci_iomap(pdev, 0, 0); card->pci_mmap = pci_iomap(pdev, 0, 0);
if (!card->pci_mmap) { if (!card->pci_mmap) {
dev_err(adapter->dev, "iomap(0) error\n"); dev_err(adapter->dev, "iomap(0) error\n");
ret = -EIO;
goto err_iomap0; goto err_iomap0;
} }
ret = pci_request_region(pdev, 2, DRV_NAME); ret = pci_request_region(pdev, 2, DRV_NAME);
...@@ -1995,6 +1996,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter) ...@@ -1995,6 +1996,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
card->pci_mmap1 = pci_iomap(pdev, 2, 0); card->pci_mmap1 = pci_iomap(pdev, 2, 0);
if (!card->pci_mmap1) { if (!card->pci_mmap1) {
dev_err(adapter->dev, "iomap(2) error\n"); dev_err(adapter->dev, "iomap(2) error\n");
ret = -EIO;
goto err_iomap2; goto err_iomap2;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment