Skip to content

Commit

Permalink
apps: zynq7: check NULL pointer in mmap()
Browse files Browse the repository at this point in the history
Check if pointer is NULL in mmap() before writing to it.

Signed-off-by: Wendy Liang <[email protected]>
  • Loading branch information
Wendy Liang committed Oct 30, 2018
1 parent e39bf08 commit c5763fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/machine/zynq7/zynq_a9_rproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ zynq_a9_proc_mmap(struct remoteproc *rproc, metal_phys_addr_t *pa,
remoteproc_add_mem(rproc, mem);
*pa = lpa;
*da = lda;
*io = tmpio;
if (io)
*io = tmpio;
return metal_io_phys_to_virt(tmpio, mem->pa);
}

Expand Down

0 comments on commit c5763fc

Please sign in to comment.