]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
scsi: ufs: fix a missing check of devm_reset_control_get
authorKangjie Lu <kjlu@umn.edu>
Fri, 15 Mar 2019 07:11:56 +0000 (02:11 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837517
[ Upstream commit 63a06181d7ce169d09843645c50fea1901bc9f0a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/scsi/ufs/ufs-hisi.c

index 452e19f8fb47027ab4c264f60da67b69eafdbf49..c2cee73a8560d380340d14e7e5343c94855410b3 100644 (file)
@@ -544,6 +544,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);