mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
77bf310084
commit
e4e62514e3
3 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue