Merge "soc: qcom: pil: NULL check before pil_memset_io"
This commit is contained in:
commit
71de11b9ad
1 changed files with 6 additions and 0 deletions
|
@ -722,6 +722,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue