diff options
author | Susheel Khiani <skhiani@codeaurora.org> | 2016-04-11 18:02:43 +0530 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-01 15:26:08 -0700 |
commit | 3b2e2a3ded5874eab1eabff80036c123a8f56684 (patch) | |
tree | 036fc4074f950035f5152503c0f58831b9cdf3c4 /drivers/soc/qcom/secure_buffer.c | |
parent | 9735edbe890b6f09dc74438b81beb37650eaddba (diff) |
msm: secure_buffer: Fix possible NULL pointer dereference
Presently we were passing NULL dma_handle while
making dma_alloc_coherent call. This is an issue
as alloc function would try to populate handle
value with dma address and would end up getting
NULL pointer error. Fix this.
Change-Id: I38ebb9bbae2d6e1e1311fe438b3c8fc3f65e5692
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
Diffstat (limited to 'drivers/soc/qcom/secure_buffer.c')
-rw-r--r-- | drivers/soc/qcom/secure_buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/soc/qcom/secure_buffer.c b/drivers/soc/qcom/secure_buffer.c index af4f572fec31..c01c225d95ab 100644 --- a/drivers/soc/qcom/secure_buffer.c +++ b/drivers/soc/qcom/secure_buffer.c @@ -402,12 +402,13 @@ bool msm_secure_v2_is_supported(void) static int __init alloc_secure_shared_memory(void) { int ret = 0; + dma_addr_t dma_handle; qcom_secure_mem = kzalloc(QCOM_SECURE_MEM_SIZE, GFP_KERNEL); if (!qcom_secure_mem) { /* Fallback to CMA-DMA memory */ qcom_secure_mem = dma_alloc_coherent(NULL, QCOM_SECURE_MEM_SIZE, - NULL, GFP_KERNEL); + &dma_handle, GFP_KERNEL); if (!qcom_secure_mem) { pr_err("Couldn't allocate memory for secure use-cases. hyp_assign_table will not work\n"); return -ENOMEM; |