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

Commit 7465c00c authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

qcom: scm: Be careful with side-effects from is_scm_armv8



Currently, when deciding which version of scm call to make in scm_call2,
we check the scm_version variable.  However, the scm_version variable is
only initialized as a side-effect of calling is_scm_armv8, which isn't
called anywhere in scm_call2.  So if someone makes an scm_call2 before
is_scm_armv8 has been called then they could get the wrong scm version.
Fix this by calling is_scm_armv8 at the top of the scm_call2
function (and bailing out if it's not v8 since scm_call2 only supports
v8 forward).  Similarly for scm_call2_atomic.

Since is_scm_armv8 caches its result the performance overhead of calling
on every invocation of scm_call2 should be negligible.

Change-Id: I46d2423ae2e4b5204fc5eefa1c6660c3c95a95b0
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 6cb8923f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment