Skip to content

Commit

Permalink
scsi: ufs: fix a missing check of devm_reset_control_get
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kangjie Lu authored and Martin K. Petersen committed Mar 19, 2019
1 parent 9e2a07e commit 63a0618
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/ufs/ufs-hisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 63a0618

Please sign in to comment.