summary refs log tree commit diff stats
path: root/ui/gtk-gl-area.c
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2024-05-08 10:53:58 -0700
committerMarc-André Lureau <marcandre.lureau@redhat.com>2024-05-14 17:14:12 +0400
commite4e62514e3cc2fc9dbae44af8b80f61c730beab4 (patch)
tree3090d355c6ce26a369080761194b1d3487f42228 /ui/gtk-gl-area.c
parent77bf310084dad38b3a2badf01766c659056f1cf2 (diff)
downloadfocaccia-qemu-e4e62514e3cc2fc9dbae44af8b80f61c730beab4.tar.gz
focaccia-qemu-e4e62514e3cc2fc9dbae44af8b80f61c730beab4.zip
ui/gtk: Check if fence_fd is equal to or greater than 0
'fence_fd' needs to be validated always before being referenced
And the passing condition should include '== 0' as 0 is a valid
value for the file descriptor.

Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20240508175403.3399895-2-dongwon.kim@intel.com>
Diffstat (limited to 'ui/gtk-gl-area.c')
-rw-r--r--ui/gtk-gl-area.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 4fff957c3f..b490727402 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -86,7 +86,7 @@ void gd_gl_area_draw(VirtualConsole *vc)
 #ifdef CONFIG_GBM
         if (dmabuf) {
             egl_dmabuf_create_fence(dmabuf);
-            if (dmabuf->fence_fd > 0) {
+            if (dmabuf->fence_fd >= 0) {
                 qemu_set_fd_handler(dmabuf->fence_fd, gd_hw_gl_flushed, NULL, vc);
                 return;
             }