diff options
author | Alan Cox <alan@linux.intel.com> | 2009-08-27 05:59:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:02:27 -0400 |
commit | 6ae56042c19afe8d6be91b5d80ba85d695fa982d (patch) | |
tree | d775f62d08a89ad06f4b1bb2026407c9e0ab2806 | |
parent | 5ec3487ac566dd443365100eab6861f004f617fb (diff) |
Staging: et131x: Take a kref for the PCI pointer we cache
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/et131x/et131x_initpci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c index 86bd55d2aeac..5485dd7ee4ee 100644 --- a/drivers/staging/et131x/et131x_initpci.c +++ b/drivers/staging/et131x/et131x_initpci.c | |||
@@ -742,6 +742,7 @@ void __devexit et131x_pci_remove(struct pci_dev *pdev) | |||
742 | unregister_netdev(netdev); | 742 | unregister_netdev(netdev); |
743 | et131x_adapter_memory_free(adapter); | 743 | et131x_adapter_memory_free(adapter); |
744 | iounmap(adapter->CSRAddress); | 744 | iounmap(adapter->CSRAddress); |
745 | pci_dev_put(adapter->pdev); | ||
745 | free_netdev(netdev); | 746 | free_netdev(netdev); |
746 | pci_release_regions(pdev); | 747 | pci_release_regions(pdev); |
747 | pci_disable_device(pdev); | 748 | pci_disable_device(pdev); |
@@ -878,7 +879,7 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev, | |||
878 | 879 | ||
879 | /* Allocate private adapter struct and copy in relevant information */ | 880 | /* Allocate private adapter struct and copy in relevant information */ |
880 | adapter = netdev_priv(netdev); | 881 | adapter = netdev_priv(netdev); |
881 | adapter->pdev = pdev; | 882 | adapter->pdev = pci_dev_get(pdev); |
882 | adapter->netdev = netdev; | 883 | adapter->netdev = netdev; |
883 | 884 | ||
884 | /* Do the same for the netdev struct */ | 885 | /* Do the same for the netdev struct */ |
@@ -1022,6 +1023,7 @@ err_mem_free: | |||
1022 | err_iounmap: | 1023 | err_iounmap: |
1023 | iounmap(adapter->CSRAddress); | 1024 | iounmap(adapter->CSRAddress); |
1024 | err_free_dev: | 1025 | err_free_dev: |
1026 | pci_dev_put(pdev); | ||
1025 | free_netdev(netdev); | 1027 | free_netdev(netdev); |
1026 | err_release_res: | 1028 | err_release_res: |
1027 | pci_release_regions(pdev); | 1029 | pci_release_regions(pdev); |