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

Commit b14f1bf3 authored by Swetha Chikkaboraiah's avatar Swetha Chikkaboraiah Committed by Jitendra Sharma
Browse files

soc: qcom: pil: NULL check before pil_memset_io



In existing implementation if vmap fails device panics for
NULL pointer access while doing pil_memset_io.
Instead check for the NULL pointer.

Change-Id: I1b9fd084a8c168b70f6e01134e4122445e4873b4
Signed-off-by: default avatarSwetha Chikkaboraiah <schikk@codeaurora.org>
parent 3b61f587
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -708,6 +708,12 @@ static void pil_clear_segment(struct pil_desc *desc)
	/* Clear memory so that unauthorized ELF code is not left behind */
	buf = desc->map_fw_mem(priv->region_start, (priv->region_end -
					priv->region_start), map_data);

	if (!buf) {
		pil_err(desc, "Failed to map memory\n");
		return;
	}

	pil_memset_io(buf, 0, (priv->region_end - priv->region_start));
	desc->unmap_fw_mem(buf, (priv->region_end - priv->region_start),
								map_data);