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

Commit 54e781e9 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta
Browse files

firmware: qcom_scm: Check for NULL before dereferencing __scm



The function qcom_scm_get_sec_dump_state dereferences __scm without
checking for NULL and could potentially lead to a NULL pointer exception.
This scenario can happen if the clinet calls qcom_scm_get_sec_dump_state
before qcom_scm driver is even probed. Hence, check for NULL before
dereferencing it.

Change-Id: Ic6f7c2b2d616645ea69a8c594c90dc01d689637f
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
parent 7531776c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ static const struct reset_control_ops qcom_scm_pas_reset_ops = {

int qcom_scm_get_sec_dump_state(u32 *dump_state)
{
	return __qcom_scm_get_sec_dump_state(__scm->dev,
	return __qcom_scm_get_sec_dump_state(__scm ? __scm->dev : NULL,
						dump_state);
}
EXPORT_SYMBOL(qcom_scm_get_sec_dump_state);