aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_pci.c
diff options
context:
space:
mode:
authorJouni Malinen <jkmaline@cc.hut.fi>2006-03-19 19:21:49 -0800
committerJohn W. Linville <linville@tuxdriver.com>2006-03-23 16:16:58 -0500
commit9320199957cebc39ccef372fa1fccf5ba3d3fd7d (patch)
treec4d89643eae57f819aa014eca6f4032d66e9ef5a /drivers/net/wireless/hostap/hostap_pci.c
parent[PATCH] hostap: Remove dead code (duplicated idx != 0) (diff)
downloadlinux-dev-9320199957cebc39ccef372fa1fccf5ba3d3fd7d.tar.xz
linux-dev-9320199957cebc39ccef372fa1fccf5ba3d3fd7d.zip
[PATCH] hostap: Fix memory leak on PCI probe error path
The Coverity checker (CID: 659, 660) spotted this resource leak on PCI probe error path. Free private data structure if pci_enable_device() fails. Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_pci.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 2e85bdced2dd..194f07097581 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -307,7 +307,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
memset(hw_priv, 0, sizeof(*hw_priv));
if (pci_enable_device(pdev))
- return -EIO;
+ goto err_out_free;
phymem = pci_resource_start(pdev, 0);
@@ -368,6 +368,8 @@ static int prism2_pci_probe(struct pci_dev *pdev,
err_out_disable:
pci_disable_device(pdev);
prism2_free_local_data(dev);
+
+ err_out_free:
kfree(hw_priv);
return -ENODEV;