summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2022-02-07 09:39:58 -0800
committerCommit Bot <commit-bot@chromium.org>2022-02-11 04:00:49 +0000
commit1b386397daac80c785114e630c83cb51e2ff7ac2 (patch)
tree439f0fce961323c6993c40b6003b4868032683fe
parentc8c61d3057675edd9345ac3f620157aa69653956 (diff)
downloadminigbm-1b386397daac80c785114e630c83cb51e2ff7ac2.tar.gz
gralloc: Fix reserved region fd check
... as fd 0 is potentially valid. BUG=b:207388558 TEST=cvd start TEST=vts -m VtsHalGraphicsMapperV4_0Target Change-Id: Idc31e294b2797491517f5d82e5ccd05a351a0cd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3441404 Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com> Tested-by: Jason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
-rw-r--r--cros_gralloc/cros_gralloc_buffer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/cros_gralloc/cros_gralloc_buffer.cc b/cros_gralloc/cros_gralloc_buffer.cc
index 2f4ceb0..98bf55e 100644
--- a/cros_gralloc/cros_gralloc_buffer.cc
+++ b/cros_gralloc/cros_gralloc_buffer.cc
@@ -150,7 +150,7 @@ int32_t cros_gralloc_buffer::flush()
int32_t cros_gralloc_buffer::get_reserved_region(void **addr, uint64_t *size)
{
- if (reserved_region_fd_ <= 0) {
+ if (reserved_region_fd_ == -1) {
drv_log("Buffer does not have reserved region.\n");
return -EINVAL;
}