Skip to content

Commit

Permalink
staging: spectra: call disable_pci_device() if pci_probe() failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent beef969 commit 4fd09f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/spectra/lld_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -2411,13 +2411,15 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
csr_base = pci_resource_start(dev, 0);
if (!csr_base) {
printk(KERN_ERR "Spectra: pci_resource_start failed!\n");
return -ENODEV;
ret = -ENODEV;
goto failed_req_csr;
}

csr_len = pci_resource_len(dev, 0);
if (!csr_len) {
printk(KERN_ERR "Spectra: pci_resource_len failed!\n");
return -ENODEV;
ret = -ENODEV;
goto failed_req_csr;
}

ret = pci_request_regions(dev, SPECTRA_NAND_NAME);
Expand Down Expand Up @@ -2464,6 +2466,7 @@ static int nand_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
failed_remap_csr:
pci_release_regions(dev);
failed_req_csr:
pci_disable_device(dev);

return ret;
}
Expand Down

0 comments on commit 4fd09f9

Please sign in to comment.