scsi: ufs: Fix error return code in ufshcd_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 28 Sep 2016 14:49:42 +0000 (14:49 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 30 Sep 2016 01:37:03 +0000 (21:37 -0400)
Fix to return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Reviewed-by: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index d2ec42512641337df8277c6c92fb58d9053be7af..05c745663c103a7ddb70d4e6845702a6c08ebd08 100644 (file)
@@ -6503,6 +6503,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
                if (IS_ERR(hba->devfreq)) {
                        dev_err(hba->dev, "Unable to register with devfreq %ld\n",
                                        PTR_ERR(hba->devfreq));
+                       err = PTR_ERR(hba->devfreq);
                        goto out_remove_scsi_host;
                }
                /* Suspend devfreq until the UFS device is detected */