mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
firmware: qcom_scm: Check for NULL before dereferencing __scm
The function qcom_scm_mem_protect_region_id 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_mem_protect_region_id before qcom_scm driver is even probed. Hence, check for NULL before dereferencing it. Change-Id: I1a9eba6d45ba8ebf73da80bca984b4dfad05042e Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
This commit is contained in:
parent
1483d01dc1
commit
cceceac1d8
2 changed files with 3 additions and 2 deletions
|
|
@ -1207,7 +1207,7 @@ int __qcom_scm_mem_protect_region_id(struct device *dev, phys_addr_t paddr,
|
|||
|
||||
desc.args[0] = paddr;
|
||||
desc.args[1] = size;
|
||||
desc.arginfo = QCOM_SCM_ARGS(2);
|
||||
desc.arginfo = QCOM_SCM_ARGS(2, QCOM_SCM_RO, QCOM_SCM_VAL);
|
||||
|
||||
ret = qcom_scm_call(dev, &desc);
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,8 @@ EXPORT_SYMBOL(qcom_scm_mem_protect_video);
|
|||
|
||||
int qcom_scm_mem_protect_region_id(phys_addr_t paddr, size_t size)
|
||||
{
|
||||
return __qcom_scm_mem_protect_region_id(__scm->dev, paddr, size);
|
||||
return __qcom_scm_mem_protect_region_id(__scm ? __scm->dev : NULL,
|
||||
paddr, size);
|
||||
}
|
||||
EXPORT_SYMBOL(qcom_scm_mem_protect_region_id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue