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

Commit c021c5df authored by Anil kumar mamidala's avatar Anil kumar mamidala
Browse files

msm: pm: null check before accessing the pointer



Move the l2 cache low power mode read code after the null
check of the rs_limits pointer.

CRs-Fixed: 587781
Change-Id: I51441f92830b1c458a212b1414c15a86fef7f8f7
Signed-off-by: default avatarAnil kumar mamidala <amami@codeaurora.org>
parent 1b611297
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1236,9 +1236,8 @@ static int msm_pm_enter(suspend_state_t state)
			rs_limits = pm_sleep_ops.lowest_limits(false,
			rs_limits = pm_sleep_ops.lowest_limits(false,
		MSM_PM_SLEEP_MODE_POWER_COLLAPSE, &time_param, &power);
		MSM_PM_SLEEP_MODE_POWER_COLLAPSE, &time_param, &power);


		l2_stat_id =  *(uint32_t *)rs_limits;

		if (rs_limits) {
		if (rs_limits) {
			l2_stat_id =  *(uint32_t *)rs_limits;
			if (pm_sleep_ops.enter_sleep)
			if (pm_sleep_ops.enter_sleep)
				ret = pm_sleep_ops.enter_sleep(
				ret = pm_sleep_ops.enter_sleep(
						msm_pm_max_sleep_time,
						msm_pm_max_sleep_time,
@@ -1251,6 +1250,7 @@ static int msm_pm_enter(suspend_state_t state)
				}
				}
			}
			}
		} else {
		} else {
			l2_stat_id = MSM_SPM_L2_MODE_LAST;
			pr_err("%s: cannot find the lowest power limit\n",
			pr_err("%s: cannot find the lowest power limit\n",
				__func__);
				__func__);
		}
		}