Commit 4886b1af authored by Namjae Jeon's avatar Namjae Jeon Committed by James Bottomley

[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: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 841f97bf
...@@ -1836,7 +1836,7 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1836,7 +1836,7 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = pci_request_regions(pdev, UFSHCD); err = pci_request_regions(pdev, UFSHCD);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "request regions failed\n"); dev_err(&pdev->dev, "request regions failed\n");
goto out_disable; goto out_host_put;
} }
hba->mmio_base = pci_ioremap_bar(pdev, 0); hba->mmio_base = pci_ioremap_bar(pdev, 0);
...@@ -1925,8 +1925,9 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1925,8 +1925,9 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id)
iounmap(hba->mmio_base); iounmap(hba->mmio_base);
out_release_regions: out_release_regions:
pci_release_regions(pdev); pci_release_regions(pdev);
out_disable: out_host_put:
scsi_host_put(host); scsi_host_put(host);
out_disable:
pci_clear_master(pdev); pci_clear_master(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
out_error: out_error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment