mirror of https://gitee.com/openkylin/linux.git
staging: rtl8187se: 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>
This commit is contained in:
parent
036b00e091
commit
beef969724
|
@ -3547,6 +3547,7 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
|
||||||
struct net_device *dev = NULL;
|
struct net_device *dev = NULL;
|
||||||
struct r8180_priv *priv = NULL;
|
struct r8180_priv *priv = NULL;
|
||||||
u8 unit = 0;
|
u8 unit = 0;
|
||||||
|
int ret = -ENODEV;
|
||||||
|
|
||||||
unsigned long pmem_start, pmem_len, pmem_flags;
|
unsigned long pmem_start, pmem_len, pmem_flags;
|
||||||
|
|
||||||
|
@ -3561,8 +3562,10 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
|
||||||
pci_set_dma_mask(pdev, 0xffffff00ULL);
|
pci_set_dma_mask(pdev, 0xffffff00ULL);
|
||||||
pci_set_consistent_dma_mask(pdev, 0xffffff00ULL);
|
pci_set_consistent_dma_mask(pdev, 0xffffff00ULL);
|
||||||
dev = alloc_ieee80211(sizeof(struct r8180_priv));
|
dev = alloc_ieee80211(sizeof(struct r8180_priv));
|
||||||
if (!dev)
|
if (!dev) {
|
||||||
return -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
goto fail_free;
|
||||||
|
}
|
||||||
priv = ieee80211_priv(dev);
|
priv = ieee80211_priv(dev);
|
||||||
priv->ieee80211 = netdev_priv(dev);
|
priv->ieee80211 = netdev_priv(dev);
|
||||||
|
|
||||||
|
@ -3641,11 +3644,12 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev,
|
||||||
free_ieee80211(dev);
|
free_ieee80211(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail_free:
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
|
|
||||||
DMESG("wlan driver load failed\n");
|
DMESG("wlan driver load failed\n");
|
||||||
pci_set_drvdata(pdev, NULL);
|
pci_set_drvdata(pdev, NULL);
|
||||||
return -ENODEV;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __devexit rtl8180_pci_remove(struct pci_dev *pdev)
|
static void __devexit rtl8180_pci_remove(struct pci_dev *pdev)
|
||||||
|
|
Loading…
Reference in New Issue