aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDavide Grohmann <davide.grohmann@arm.com>2021-06-15 13:21:15 +0200
committerDavide Grohmann <davide.grohmann@arm.com>2021-08-12 10:13:18 +0200
commit1c26baa1e8fde9f730c0ef472187937619d32471 (patch)
treee26195476a37257a50fab617c29bc1e339e5383d /kernel
parent2cd539705ba4b510859f18e9815a72950ddd96fa (diff)
downloadethos-u-linux-driver-stack-1c26baa1e8fde9f730c0ef472187937619d32471.tar.gz
Fix: do not attempt to read data from mailbox when length is 0
Also add a call to send a ping message in the inference_runner example app. Change-Id: Ia2b4abf5fec8285c320ec0f28df167ff2ea13d82
Diffstat (limited to 'kernel')
-rw-r--r--kernel/ethosu_mailbox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 158a7f5..7f159f3 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -128,7 +128,9 @@ static int ethosu_queue_read(struct ethosu_mailbox *mbox,
uint32_t rpos = queue->header.read;
size_t queue_avail = ethosu_queue_available(queue);
- if (queue_avail == 0)
+ if (length == 0)
+ return 0;
+ else if (queue_avail == 0)
return -ENOMSG;
else if (length > queue_avail)
return -EBADMSG;