[SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove.

Avoid dereferencing a NULL pointer if scsi_host_alloc is failed.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Namjae Jeon 2012-05-20 03:08:01 -04:00 committed by James Bottomley
parent 841f97bffc
commit 4886b1afee
1 changed files with 3 additions and 2 deletions

View File

@ -1836,7 +1836,7 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = pci_request_regions(pdev, UFSHCD);
if (err < 0) {
dev_err(&pdev->dev, "request regions failed\n");
goto out_disable;
goto out_host_put;
}
hba->mmio_base = pci_ioremap_bar(pdev, 0);
@ -1925,8 +1925,9 @@ out_iounmap:
iounmap(hba->mmio_base);
out_release_regions:
pci_release_regions(pdev);
out_disable:
out_host_put:
scsi_host_put(host);
out_disable:
pci_clear_master(pdev);
pci_disable_device(pdev);
out_error: