aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-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;