Skip to content

Commit ec3ac05

Browse files
Treehugger Robotandroid-build-merge-worker-robot
authored andcommitted
Merge "libbinder: Return error instead of crashing on closed Trusty connection" into main am: f3a1244 am: c619ec6
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3163657 Change-Id: I81ad804284de07be95bd7c7f9ddffae240739b78 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2 parents 86a707a + c619ec6 commit ec3ac05

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libs/binder/trusty/RpcServerTrusty.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ int RpcServerTrusty::handleMessage(const tipc_port* /*port*/, handle_t /*chan*/,
151151

152152
int RpcServerTrusty::handleMessageInternal(void* ctx) {
153153
auto* channelContext = reinterpret_cast<ChannelContext*>(ctx);
154-
LOG_ALWAYS_FATAL_IF(channelContext == nullptr,
155-
"bad state: message received on uninitialized channel");
154+
if (channelContext == nullptr) {
155+
LOG_RPC_DETAIL("bad state: message received on uninitialized channel");
156+
return ERR_BAD_STATE;
157+
}
156158

157159
auto& session = channelContext->session;
158160
auto& connection = channelContext->connection;

0 commit comments

Comments
 (0)