summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-hisi.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 02:11:56 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-19 14:36:28 -0400
commit63a06181d7ce169d09843645c50fea1901bc9f0a (patch)
tree8df0cf2f35dd1cbbc0af4aba04744be6f0199469 /drivers/scsi/ufs/ufs-hisi.c
parent9e2a07e128ae844a14e32d964443cff0688da2aa (diff)
scsi: ufs: fix a missing check of devm_reset_control_get
devm_reset_control_get could fail, so the fix checks its return value and passes the error code upstream in case it fails. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Acked-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-hisi.c')
-rw-r--r--drivers/scsi/ufs/ufs-hisi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c
index 0e855b5afe82..2f592df921d9 100644
--- a/drivers/scsi/ufs/ufs-hisi.c
+++ b/drivers/scsi/ufs/ufs-hisi.c
@@ -587,6 +587,10 @@ static int ufs_hisi_init_common(struct ufs_hba *hba)
ufshcd_set_variant(hba, host);
host->rst = devm_reset_control_get(dev, "rst");
+ if (IS_ERR(host->rst)) {
+ dev_err(dev, "%s: failed to get reset control\n", __func__);
+ return PTR_ERR(host->rst);
+ }
ufs_hisi_set_pm_lvl(hba);