aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2013-01-25 15:56:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-30 15:07:04 -0500
commit3220712d3aa4f5df12b7305ce340f6d216a84477 (patch)
treef0a3e0986984d9d53390af2506af853bd792504f /drivers/net/wireless/mwifiex
parentbaf58b0e8f0e460e252e40f5fdf393b01a3cef7d (diff)
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>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 7415ac8c3ad7..df88e65595c8 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -1985,6 +1985,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
1985 card->pci_mmap = pci_iomap(pdev, 0, 0); 1985 card->pci_mmap = pci_iomap(pdev, 0, 0);
1986 if (!card->pci_mmap) { 1986 if (!card->pci_mmap) {
1987 dev_err(adapter->dev, "iomap(0) error\n"); 1987 dev_err(adapter->dev, "iomap(0) error\n");
1988 ret = -EIO;
1988 goto err_iomap0; 1989 goto err_iomap0;
1989 } 1990 }
1990 ret = pci_request_region(pdev, 2, DRV_NAME); 1991 ret = pci_request_region(pdev, 2, DRV_NAME);
@@ -1995,6 +1996,7 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter)
1995 card->pci_mmap1 = pci_iomap(pdev, 2, 0); 1996 card->pci_mmap1 = pci_iomap(pdev, 2, 0);
1996 if (!card->pci_mmap1) { 1997 if (!card->pci_mmap1) {
1997 dev_err(adapter->dev, "iomap(2) error\n"); 1998 dev_err(adapter->dev, "iomap(2) error\n");
1999 ret = -EIO;
1998 goto err_iomap2; 2000 goto err_iomap2;
1999 } 2001 }
2000 2002