aboutsummaryrefslogtreecommitdiff
path: root/hal_io_eim.c
diff options
context:
space:
mode:
Diffstat (limited to 'hal_io_eim.c')
-rw-r--r--hal_io_eim.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hal_io_eim.c b/hal_io_eim.c
index 4f9df65..7d2e32a 100644
--- a/hal_io_eim.c
+++ b/hal_io_eim.c
@@ -98,6 +98,9 @@ hal_error_t hal_io_write(const hal_core_t *core, hal_addr_t offset, const uint8_
{
hal_error_t err;
+ if (core == NULL)
+ return HAL_ERROR_CORE_NOT_FOUND;
+
if (len % 4 != 0)
return HAL_ERROR_IO_BAD_COUNT;
@@ -122,6 +125,9 @@ hal_error_t hal_io_read(const hal_core_t *core, hal_addr_t offset, uint8_t *buf,
int rlen = len;
hal_error_t err;
+ if (core == NULL)
+ return HAL_ERROR_CORE_NOT_FOUND;
+
if (len % 4 != 0)
return HAL_ERROR_IO_BAD_COUNT;