Add bounds checking asserts to memmap IO driver
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Mon, 13 Feb 2017 13:06:18 +0000 (13:06 +0000)
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>
Tue, 14 Feb 2017 14:23:58 +0000 (14:23 +0000)
commit69c043b25f7571052d1357680ffd374b94b01a41
tree8cd122dba489dd8a5b2f9144ba1154bc6b3e7dcc
parent4d07e7821e19dc1ebc640f5264c2a769354c8b2d
Add bounds checking asserts to memmap IO driver

The memmap IO driver doesn't perform bounds check when reading, writing,
or seeking. The onus to vet parameters is on the caller, and this patch
asserts that:

  - non-negative size is specified for for backing memory;

  - valid parameters are passed into the driver for read, write and seek
    operations.

Change-Id: I6518c4065817e640e9e7e39a8a4577655f2680f7
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
drivers/io/io_memmap.c