summaryrefslogtreecommitdiff
path: root/gralloc/alloc_device.cpp
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2017-05-08 12:46:13 -0700
committerChia-I Wu <olv@google.com>2017-05-08 13:35:44 -0700
commita12e37d48f32a32c919228a4649e50c89587db22 (patch)
tree15403bd1830e0b2d910d1fb152b8210cd873e61d /gralloc/alloc_device.cpp
parentfba69b56ea4522483aa0df21342362b219a146dd (diff)
downloadhikey-a12e37d48f32a32c919228a4649e50c89587db22.tar.gz
gralloc: fix numFds for framebuffer handles
It is an error to claim one fd, while the fd is -1. Bug: 37550237 Test: boots Change-Id: I7ad0d7c2bbe0bff8f462666bbf5fab38e9115578
Diffstat (limited to 'gralloc/alloc_device.cpp')
-rw-r--r--gralloc/alloc_device.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index 67734050..cef58511 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -333,6 +333,12 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t *dev, size_t size, in
#endif
}
+
+ // correct numFds/numInts when there is no dmabuf fd
+ if (hnd->share_fd < 0) {
+ hnd->numFds--;
+ hnd->numInts++;
+ }
#endif
*pHandle = hnd;