summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUday Kiran Pichika <pichika@codeaurora.org>2018-04-10 15:37:35 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-10-26 00:02:59 -0700
commitd4745c5002df133219f9f155bb043208084e5a62 (patch)
tree5a3dca835d66af5a54994ed2c7ed59ecd4052466
parentdb3c1b8fdd29df9de1a3a26ca19a320b92f1ebc1 (diff)
downloadandroid_hardware_qcom_sdm710_display-d4745c5002df133219f9f155bb043208084e5a62.tar.gz
android_hardware_qcom_sdm710_display-d4745c5002df133219f9f155bb043208084e5a62.tar.bz2
android_hardware_qcom_sdm710_display-d4745c5002df133219f9f155bb043208084e5a62.zip
gralloc: Fix race condition in gralloc
- Add mutex lock while accessing handles_map Change-Id: Ibbe77e87020e655f6ebeb2428a13555460b3ac7d CRs-Fixed:
-rw-r--r--gralloc/gr_buf_mgr.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gralloc/gr_buf_mgr.cpp b/gralloc/gr_buf_mgr.cpp
index c8309525..985dd3ef 100644
--- a/gralloc/gr_buf_mgr.cpp
+++ b/gralloc/gr_buf_mgr.cpp
@@ -376,6 +376,7 @@ Error BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_h
}
Error BufferManager::Dump(std::ostringstream *os) {
+ std::lock_guard<std::mutex> buffer_lock(buffer_lock_);
for (auto it : handles_map_) {
auto buf = it.second;
auto hnd = buf->handle;