Commit 0a1d3b8e authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman

scsi: ufs: fix a missing check of devm_reset_control_get

[ Upstream commit 63a06181 ]

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: default avatarKangjie Lu <kjlu@umn.edu>
Acked-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 97b73399
...@@ -587,6 +587,10 @@ static int ufs_hisi_init_common(struct ufs_hba *hba) ...@@ -587,6 +587,10 @@ static int ufs_hisi_init_common(struct ufs_hba *hba)
ufshcd_set_variant(hba, host); ufshcd_set_variant(hba, host);
host->rst = devm_reset_control_get(dev, "rst"); 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); ufs_hisi_set_pm_lvl(hba);
......
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