diff options
author | Umang Jain <umang.jain@ideasonboard.com> | 2021-09-07 20:29:49 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2021-09-09 11:44:30 +0530 |
commit | 68fe3b058afdf10710d02302f06f27bda5ef7fd4 (patch) | |
tree | d6c62c4be0fa4d46cd728468e2881f3291a7fe07 /src/android/mm | |
parent | 39c2d5dc95e46b8c1659b721521e4e438ab7d8a3 (diff) |
android: mm: cros_camera_buffer: Log failure error on cleanup
Failure can still happen by CameraBufferManager during Unlock() and/or
Deregister() of camera3Buffer handles. We should be logging those
errors as well.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/mm')
-rw-r--r-- | src/android/mm/cros_camera_buffer.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp index ec45e04c..86770135 100644 --- a/src/android/mm/cros_camera_buffer.cpp +++ b/src/android/mm/cros_camera_buffer.cpp @@ -73,10 +73,20 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, CameraBuffer::Private::~Private() { - if (mapped_) - bufferManager_->Unlock(handle_); - if (registered_) - bufferManager_->Deregister(handle_); + int ret; + if (mapped_) { + ret = bufferManager_->Unlock(handle_); + if (ret != 0) + LOG(HAL, Error) << "Failed to unlock buffer: " + << strerror(-ret); + } + + if (registered_) { + ret = bufferManager_->Deregister(handle_); + if (ret != 0) + LOG(HAL, Error) << "Failed to deregister buffer: " + << strerror(-ret); + } } unsigned int CameraBuffer::Private::numPlanes() const |