diff options
author | Mikael Olsson <mikael.olsson@arm.com> | 2024-04-05 16:58:49 +0200 |
---|---|---|
committer | Mikael Olsson <mikael.olsson@arm.com> | 2024-04-16 11:51:05 +0000 |
commit | c218583a68089af2f474455b09b22df4154587cc (patch) | |
tree | 29bfc5460380f0d42b8b6251df1083f444b0799e | |
parent | 8899685da506ede95f55922d667482331c1cbbda (diff) | |
download | ethos-u-core-platform-c218583a68089af2f474455b09b22df4154587cc.tar.gz |
Fix zero init of class members in message handler
There are instances of class members not being zero initialized in the
message handler. To avoid possible issues with using the class members
when they have an intermediate value, the constructors have been updated
to zero initialize all the member variables.
Change-Id: Ib539410a8f1486f8155272731f5cb7006c22ac7a
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
-rw-r--r-- | applications/message_handler_openamp/inference_runner.cpp | 2 | ||||
-rw-r--r-- | applications/message_handler_openamp/message_handler.cpp | 2 | ||||
-rw-r--r-- | applications/message_handler_openamp/remoteproc.cpp | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/applications/message_handler_openamp/inference_runner.cpp b/applications/message_handler_openamp/inference_runner.cpp index bf07819..659d685 100644 --- a/applications/message_handler_openamp/inference_runner.cpp +++ b/applications/message_handler_openamp/inference_runner.cpp @@ -51,7 +51,7 @@ InferenceRunner::InferenceRunner(uint8_t *tensorArena, MessageHandler::InferenceQueue &_inferenceQueue, MessageHandler::ResponseQueue &_responseQueue) : inferenceQueue(_inferenceQueue), - responseQueue(_responseQueue), inference(tensorArena, arenaSize) { + responseQueue(_responseQueue), inference(tensorArena, arenaSize), taskHandle() { BaseType_t ret = xTaskCreate(inferenceTask, "inferenceTask", 8 * 1024, this, 4, &taskHandle); if (ret != pdPASS) { LOG_ERR("Failed to create inference task"); diff --git a/applications/message_handler_openamp/message_handler.cpp b/applications/message_handler_openamp/message_handler.cpp index fa93a48..dfed04c 100644 --- a/applications/message_handler_openamp/message_handler.cpp +++ b/applications/message_handler_openamp/message_handler.cpp @@ -109,7 +109,7 @@ bool getIndexedNetwork(const uint32_t index, void *&data, size_t &size) { *****************************************************************************/ MessageHandler::MessageHandler(RProc &_rproc, const char *const _name) : - Rpmsg(_rproc, _name), capabilities(getCapabilities()) { + Rpmsg(_rproc, _name), inferenceQueue(), responseQueue(), capabilities(getCapabilities()), taskHandle() { BaseType_t ret = xTaskCreate(responseTask, "responseTask", 1024, this, 3, &taskHandle); if (ret != pdPASS) { LOG_ERR("Failed to create response task"); diff --git a/applications/message_handler_openamp/remoteproc.cpp b/applications/message_handler_openamp/remoteproc.cpp index c2db93a..48dd4e8 100644 --- a/applications/message_handler_openamp/remoteproc.cpp +++ b/applications/message_handler_openamp/remoteproc.cpp @@ -44,7 +44,8 @@ void setupRProcMem(remoteproc &rproc, *****************************************************************************/ RProc::RProc(Mailbox::Mailbox &_mailbox, resource_table &table, size_t tableSize) : - mailbox(_mailbox), ops({}), vdev(nullptr), mems(), regions(), notifySemaphore(xSemaphoreCreateBinary()) { + mailbox(_mailbox), ops({}), vdev(nullptr), rsc_mem(), rsc_region(), mems(), regions(), + notifySemaphore(xSemaphoreCreateBinary()), notifyHandle() { ops.init = init; // initialize the remoteproc instance ops.remove = remove; // remove the remoteproc instance ops.handle_rsc = handle_rsc; // handle the vendor specific resource |