aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-08-23 10:43:08 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-09-07 10:42:32 +0200
commit27fe8e06f3ceb6bcd606daeca5fb572c1ccdb9e7 (patch)
tree0e68619d8e7f0bb8bbb283fbc7d836268c44f0d2
parentec90223ed8fd3c7e08791b62aaecf6d8b84a7230 (diff)
downloadethos-u-linux-driver-stack-27fe8e06f3ceb6bcd606daeca5fb572c1ccdb9e7.tar.gz
Fix mailbox clean up on inference request failure
When an inference request fails, the mailbox message registered for the request is not unregistered, causing the mailbox's IDR to be left with an entry for the message with a dangling pointer to the freed inference. The dangling pointer later causes the mailbox clean up to crash when it attempts to call the fail callback for the IDR entry. The clean up for a failed inference request has now been fixed so it unregisters the message from the mailbox. Change-Id: Ida8015c88afee9cad074289be4d65947854c9e6b Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
-rw-r--r--kernel/ethosu_inference.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/ethosu_inference.c b/kernel/ethosu_inference.c
index 50007d0..6d3405d 100644
--- a/kernel/ethosu_inference.c
+++ b/kernel/ethosu_inference.c
@@ -385,6 +385,8 @@ put_ifm:
while (inf->ifm_count-- > 0)
ethosu_buffer_put(inf->ifm[inf->ifm_count]);
+ ethosu_mailbox_deregister(mailbox, &inf->msg);
+
kfree:
memset(inf, 0, sizeof(*inf));
devm_kfree(dev, inf);