diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-08-09 23:51:59 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-31 14:48:09 -0700 |
commit | 3a8f2d3c716a218f1499041d74edb07638b45559 (patch) | |
tree | 93c230c565204653122b48d6076a28463e2566a5 /drivers | |
parent | f0903863099668d6b03c7ea90b2e58a7ad1be6a3 (diff) | |
download | linux-3.10-3a8f2d3c716a218f1499041d74edb07638b45559.tar.gz linux-3.10-3a8f2d3c716a218f1499041d74edb07638b45559.tar.bz2 linux-3.10-3a8f2d3c716a218f1499041d74edb07638b45559.zip |
staging: rtl8187e: call disable_pci_device() if pci_probe() failed
Driver should call disable_pci_device() if it returns from pci_probe()
with error.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192e/r8192E_core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c index 17a806f9ee7..2334ccd5fc2 100644 --- a/drivers/staging/rtl8192e/r8192E_core.c +++ b/drivers/staging/rtl8192e/r8192E_core.c @@ -6325,6 +6325,7 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev, struct net_device *dev = NULL; struct r8192_priv *priv= NULL; u8 unit = 0; + int ret = -ENODEV; #ifdef CONFIG_RTL8192_IO_MAP unsigned long pio_start, pio_len, pio_flags; @@ -6344,8 +6345,10 @@ static int __devinit rtl8192_pci_probe(struct pci_dev *pdev, pci_set_dma_mask(pdev, 0xffffff00ULL); pci_set_consistent_dma_mask(pdev,0xffffff00ULL); dev = alloc_ieee80211(sizeof(struct r8192_priv)); - if (!dev) - return -ENOMEM; + if (!dev) { + ret = -ENOMEM; + goto fail_free; + } pci_set_drvdata(pdev, dev); SET_NETDEV_DEV(dev, &pdev->dev); @@ -6494,11 +6497,12 @@ fail: free_ieee80211(dev); } +fail_free: pci_disable_device(pdev); DMESG("wlan driver load failed\n"); pci_set_drvdata(pdev, NULL); - return -ENODEV; + return ret; } |