summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/io/io_fip.c2
-rw-r--r--drivers/io/io_memmap.c3
-rw-r--r--drivers/io/io_storage.c5
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c
index 99cf15b9..bdacc9c0 100644
--- a/drivers/io/io_fip.c
+++ b/drivers/io/io_fip.c
@@ -299,7 +299,9 @@ static int fip_file_read(io_entity_t *entity, uintptr_t buffer, size_t length,
uintptr_t backend_handle;
assert(entity != NULL);
+#ifndef PLAT_ALLOW_ZERO_ADDR_COPY
assert(buffer != (uintptr_t)NULL);
+#endif
assert(length_read != NULL);
assert(entity->info != (uintptr_t)NULL);
diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c
index fe39652b..5aedd010 100644
--- a/drivers/io/io_memmap.c
+++ b/drivers/io/io_memmap.c
@@ -32,6 +32,7 @@
#include <debug.h>
#include <io_driver.h>
#include <io_storage.h>
+#include <platform_def.h>
#include <string.h>
/* As we need to be able to keep state for seek, only one file can be open
@@ -185,7 +186,9 @@ static int memmap_block_read(io_entity_t *entity, uintptr_t buffer,
file_state_t *fp;
assert(entity != NULL);
+#ifndef PLAT_ALLOW_ZERO_ADDR_COPY
assert(buffer != (uintptr_t)NULL);
+#endif
assert(length_read != NULL);
fp = (file_state_t *)entity->info;
diff --git a/drivers/io/io_storage.c b/drivers/io/io_storage.c
index 7cb1a6aa..45c3e568 100644
--- a/drivers/io/io_storage.c
+++ b/drivers/io/io_storage.c
@@ -302,7 +302,10 @@ int io_read(uintptr_t handle,
size_t *length_read)
{
int result = -ENODEV;
- assert(is_valid_entity(handle) && (buffer != (uintptr_t)NULL));
+ assert(is_valid_entity(handle));
+#ifndef PLAT_ALLOW_ZERO_ADDR_COPY
+ assert(buffer != (uintptr_t)NULL);
+#endif
io_entity_t *entity = (io_entity_t *)handle;