summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-11-19 02:57:22 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-11-19 02:57:22 +0000
commitc619ec65b8190b5b67cb1c07565abc8e0228369d (patch)
tree5ac37026b6198d448d8f446d5eef231eb3642be1
parent8c297a8694b6a2e06da1519302012530857ddc7f (diff)
parentf3a12447be302601cf40fcdf2432262e4377bd51 (diff)
Merge "libbinder: Return error instead of crashing on closed Trusty connection" into main am: f3a12447be
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3163657 Change-Id: I6cf325ea095bce32c068c9eec28b4c538c697bfb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/binder/trusty/RpcServerTrusty.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/binder/trusty/RpcServerTrusty.cpp b/libs/binder/trusty/RpcServerTrusty.cpp
index 17919c2a25..05800464ac 100644
--- a/libs/binder/trusty/RpcServerTrusty.cpp
+++ b/libs/binder/trusty/RpcServerTrusty.cpp
@@ -151,8 +151,10 @@ int RpcServerTrusty::handleMessage(const tipc_port* /*port*/, handle_t /*chan*/,
int RpcServerTrusty::handleMessageInternal(void* ctx) {
auto* channelContext = reinterpret_cast<ChannelContext*>(ctx);
- LOG_ALWAYS_FATAL_IF(channelContext == nullptr,
- "bad state: message received on uninitialized channel");
+ if (channelContext == nullptr) {
+ LOG_RPC_DETAIL("bad state: message received on uninitialized channel");
+ return ERR_BAD_STATE;
+ }
auto& session = channelContext->session;
auto& connection = channelContext->connection;