From 53b6ffe5af3951e8784c451ef8c4ff19f3d6b196 Mon Sep 17 00:00:00 2001 From: Frederick Mayle Date: Fri, 15 Jul 2022 20:14:01 +0000 Subject: libbinder: Remove Parcel argument from Parcel::release_func This enforces a clearer separation of concerns between the data owner and the parcel code. It happened to reveal an edge case where FDs are prematurely closed (tracking a fix in b/239222407). Test: TH Bug: 239222407 Change-Id: I54ff0c8e4a8f64afd529092d2038dac40c853371 --- libs/binder/RpcState.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libs/binder/RpcState.cpp') diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp index 633fea9b03..1c5654c597 100644 --- a/libs/binder/RpcState.cpp +++ b/libs/binder/RpcState.cpp @@ -586,13 +586,12 @@ status_t RpcState::transactAddress(const sp& connecti return waitForReply(connection, session, reply); } -static void cleanup_reply_data(Parcel* p, const uint8_t* data, size_t dataSize, - const binder_size_t* objects, size_t objectsCount) { - (void)p; +static void cleanup_reply_data(const uint8_t* data, size_t dataSize, const binder_size_t* objects, + size_t objectsCount) { delete[] const_cast(data); (void)dataSize; LOG_ALWAYS_FATAL_IF(objects != nullptr); - LOG_ALWAYS_FATAL_IF(objectsCount != 0, "%zu objects remaining", objectsCount); + (void)objectsCount; } status_t RpcState::waitForReply(const sp& connection, @@ -799,9 +798,8 @@ status_t RpcState::processTransact( std::move(ancillaryFds)); } -static void do_nothing_to_transact_data(Parcel* p, const uint8_t* data, size_t dataSize, +static void do_nothing_to_transact_data(const uint8_t* data, size_t dataSize, const binder_size_t* objects, size_t objectsCount) { - (void)p; (void)data; (void)dataSize; (void)objects; -- cgit v1.2.3-59-g8ed1b