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>
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);
failed_remap_csr:
pci_release_regions(dev);
failed_req_csr:
+ pci_disable_device(dev);
return ret;
}