diff options
author | Namjae Jeon <linkinjeon@gmail.com> | 2012-05-20 03:08:01 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-23 04:29:39 -0400 |
commit | 4886b1afee5aaccc2fb3202620a5608caf0c9284 (patch) | |
tree | c8ae9c296c1a14b762dc997b8f783428c4b93149 | |
parent | 841f97bffc11daaef9eb28d201be25b1509db97d (diff) |
[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>
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 4e010b727818..6a4fd00117ca 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c | |||
@@ -1836,7 +1836,7 @@ ufshcd_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1836 | err = pci_request_regions(pdev, UFSHCD); | 1836 | err = pci_request_regions(pdev, UFSHCD); |
1837 | if (err < 0) { | 1837 | if (err < 0) { |
1838 | dev_err(&pdev->dev, "request regions failed\n"); | 1838 | dev_err(&pdev->dev, "request regions failed\n"); |
1839 | goto out_disable; | 1839 | goto out_host_put; |
1840 | } | 1840 | } |
1841 | 1841 | ||
1842 | hba->mmio_base = pci_ioremap_bar(pdev, 0); | 1842 | hba->mmio_base = pci_ioremap_bar(pdev, 0); |
@@ -1925,8 +1925,9 @@ out_iounmap: | |||
1925 | iounmap(hba->mmio_base); | 1925 | iounmap(hba->mmio_base); |
1926 | out_release_regions: | 1926 | out_release_regions: |
1927 | pci_release_regions(pdev); | 1927 | pci_release_regions(pdev); |
1928 | out_disable: | 1928 | out_host_put: |
1929 | scsi_host_put(host); | 1929 | scsi_host_put(host); |
1930 | out_disable: | ||
1930 | pci_clear_master(pdev); | 1931 | pci_clear_master(pdev); |
1931 | pci_disable_device(pdev); | 1932 | pci_disable_device(pdev); |
1932 | out_error: | 1933 | out_error: |