[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] ui/gtk: making dmabuf NULL when it's released.
From: |
Dongwon Kim |
Subject: |
[PATCH] ui/gtk: making dmabuf NULL when it's released. |
Date: |
Wed, 21 Jun 2023 15:11:34 -0700 |
Set vc->gfx.guest_fb.dmabuf to NULL to prevent any further access
to it after the dmabuf is released.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
ui/gtk.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/gtk.c b/ui/gtk.c
index e50f950f2b..0b8bf8ea8a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -587,8 +587,12 @@ static bool gd_has_dmabuf(DisplayChangeListener *dcl)
static void gd_gl_release_dmabuf(DisplayChangeListener *dcl,
QemuDmaBuf *dmabuf)
{
+ VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
#ifdef CONFIG_GBM
egl_dmabuf_release_texture(dmabuf);
+ if (vc->gfx.guest_fb.dmabuf == dmabuf) {
+ vc->gfx.guest_fb.dmabuf = NULL;
+ }
#endif
}
--
2.34.1
- [PATCH] ui/gtk: making dmabuf NULL when it's released.,
Dongwon Kim <=