From d7ce9e5b1795eaa7d689b83994cdd3d05ad6991a Mon Sep 17 00:00:00 2001 From: Amy Zhang Date: Fri, 5 Mar 2021 16:19:26 -0800 Subject: [PATCH] Add missing return in Tuner default impl getAvSharedHandle after hidl_cb Per CTS automation test failure logs: Abort message: 'getAvSharedHandle: _hidl_cb called a second time, but must be called once.' this should be the root cause of the failure. Couldn't reproduce locally. Test: make Bug: 181997400 Change-Id: Ib3fb5ad535ab51cc7281c3f81a61d1913a1f4e65 --- tv/tuner/1.1/default/Filter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/tuner/1.1/default/Filter.cpp b/tv/tuner/1.1/default/Filter.cpp index aec1fd0576..5ddac9909f 100644 --- a/tv/tuner/1.1/default/Filter.cpp +++ b/tv/tuner/1.1/default/Filter.cpp @@ -259,11 +259,14 @@ Return Filter::getAvSharedHandle(getAvSharedHandle_cb _hidl_cb) { int av_fd = createAvIonFd(BUFFER_SIZE_16M); if (av_fd == -1) { _hidl_cb(Result::UNKNOWN_ERROR, NULL, 0); + return Void(); } native_handle_t* nativeHandle = createNativeHandle(av_fd); if (nativeHandle == NULL) { + ::close(av_fd); _hidl_cb(Result::UNKNOWN_ERROR, NULL, 0); + return Void(); } mSharedAvMemHandle.setTo(nativeHandle, /*shouldOwn=*/true); ::close(av_fd);