Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4eb78fc2 authored by Asutosh Das's avatar Asutosh Das
Browse files

scsi: ufs-qti: Check for valid vcc before accessing



This patch fixes a NULL pointer dereference by checking
if vccq & vccq2 are valid before dereferencing it.

Change-Id: Ieb5aefab77428adbbbbf892f2be1a9942d7c3851
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 90ae165d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8323,9 +8323,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
	 * during system suspend events. This will cause the UFS
	 * device to re-initialize upon system resume events.
	 */
	if ((hba->dev_info.w_spec_version >= 0x300 &&
	if ((hba->dev_info.w_spec_version >= 0x300 && hba->vreg_info.vccq &&
		hba->vreg_info.vccq->sys_suspend_pwr_off) ||
		(hba->dev_info.w_spec_version < 0x300 &&
		(hba->dev_info.w_spec_version < 0x300 && hba->vreg_info.vccq2 &&
		hba->vreg_info.vccq2->sys_suspend_pwr_off))
		hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
				UFS_POWERDOWN_PWR_MODE,