Handle error returned by IBurstContext::freeMemory
Unhandled HIDL errors result in a crash. This CL handles any errors from
IBurstContext::freeMemory by logging the error and continuing with the
rest of the function.
Bug: N/A
Test: mma
Change-Id: Ic433a627137df4d275a1b0d2d800d592afc1a18c
diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
index b4b6f68..8ce96c4 100644
--- a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
+++ b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
@@ -176,7 +176,10 @@
std::lock_guard guard(mMutex);
const int32_t slot = mMemoryIdToSlot.at(memory);
if (mBurstContext) {
- mBurstContext->freeMemory(slot);
+ const auto ret = mBurstContext->freeMemory(slot);
+ if (!ret.isOk()) {
+ LOG(ERROR) << "IBustContext::freeMemory failed: " << ret.description();
+ }
}
mMemoryIdToSlot.erase(memory);
mMemoryCache[slot] = {};