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

Commit 9a730488 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: secure_buffer: Fix possible NULL pointer dereference" into msm-4.8

parents ed178edb 5f96142c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -403,12 +403,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;