diff options
-rw-r--r-- | system/gralloc/gralloc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index 0379d329..e3bf5d6f 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -802,7 +802,9 @@ static int gralloc_free(alloc_device_t* dev, int32_t openCount = 1; int32_t* openCountPtr = &openCount; - if (isHidlGralloc) { openCountPtr = getOpenCountPtr(cb); } + if (isHidlGralloc && cb->ashmemBase) { + openCountPtr = getOpenCountPtr(cb); + } if (*openCountPtr > 0) { DEFINE_AND_VALIDATE_HOST_CONNECTION; |