diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-01-18 16:24:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-22 16:01:30 -0500 |
commit | a2ca8ecb8ffc985e82c9570c3837408f7efe8c9d (patch) | |
tree | 571b1266c73e1c7ab993245c792a9feb9e96cd98 /drivers/net/wireless/mwl8k.c | |
parent | 7532c7d0138a4984eb0c8b12b9c310cf8a6d6977 (diff) |
mwl8k: don't return zero on failure paths in mwl8k_probe[_hw]()
If pci_iomap() fails in mwl8k_probe(), it breaks off initialization,
deallocates all resources, but returns zero.
There is a similar issue when priv->rxd_ops is NULL in mwl8k_probe_hw().
The patch adds proper error code return values.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index a9c078899252..68357641c414 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -5555,6 +5555,7 @@ static int mwl8k_probe_hw(struct ieee80211_hw *hw) | |||
5555 | if (priv->rxd_ops == NULL) { | 5555 | if (priv->rxd_ops == NULL) { |
5556 | wiphy_err(hw->wiphy, | 5556 | wiphy_err(hw->wiphy, |
5557 | "Driver does not have AP firmware image support for this hardware\n"); | 5557 | "Driver does not have AP firmware image support for this hardware\n"); |
5558 | rc = -ENOENT; | ||
5558 | goto err_stop_firmware; | 5559 | goto err_stop_firmware; |
5559 | } | 5560 | } |
5560 | } else { | 5561 | } else { |
@@ -5901,6 +5902,7 @@ static int mwl8k_probe(struct pci_dev *pdev, | |||
5901 | priv->sram = pci_iomap(pdev, 0, 0x10000); | 5902 | priv->sram = pci_iomap(pdev, 0, 0x10000); |
5902 | if (priv->sram == NULL) { | 5903 | if (priv->sram == NULL) { |
5903 | wiphy_err(hw->wiphy, "Cannot map device SRAM\n"); | 5904 | wiphy_err(hw->wiphy, "Cannot map device SRAM\n"); |
5905 | rc = -EIO; | ||
5904 | goto err_iounmap; | 5906 | goto err_iounmap; |
5905 | } | 5907 | } |
5906 | 5908 | ||
@@ -5913,6 +5915,7 @@ static int mwl8k_probe(struct pci_dev *pdev, | |||
5913 | priv->regs = pci_iomap(pdev, 2, 0x10000); | 5915 | priv->regs = pci_iomap(pdev, 2, 0x10000); |
5914 | if (priv->regs == NULL) { | 5916 | if (priv->regs == NULL) { |
5915 | wiphy_err(hw->wiphy, "Cannot map device registers\n"); | 5917 | wiphy_err(hw->wiphy, "Cannot map device registers\n"); |
5918 | rc = -EIO; | ||
5916 | goto err_iounmap; | 5919 | goto err_iounmap; |
5917 | } | 5920 | } |
5918 | } | 5921 | } |