On 20/3/24 21:50, dongwon....@intel.com wrote:
From: Dongwon Kim <dongwon....@intel.com>

This commit introduces new methods within ui/console to handle the allocation,
initialization, and field retrieval of QemuDmaBuf. By isolating these
operations within ui/console, it enhances safety and encapsulation of
the struct.

Cc: Philippe Mathieu-Daudé <phi...@linaro.org>
Cc: Marc-André Lureau <marcandre.lur...@redhat.com>
Cc: Vivek Kasireddy <vivek.kasire...@intel.com>
Signed-off-by: Dongwon Kim <dongwon....@intel.com>
---
  include/ui/console.h | 10 ++++++++
  ui/console.c         | 55 ++++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 65 insertions(+)


  void dpy_gl_release_dmabuf(QemuConsole *con,
                            QemuDmaBuf *dmabuf)
  {
@@ -1145,6 +1199,7 @@ void dpy_gl_release_dmabuf(QemuConsole *con,
          if (dcl->ops->dpy_gl_release_dmabuf) {
              dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
          }
+        g_free(dmabuf);

This makes vhost_user_gpu_handle_display() crash, see VhostUserGPU.

      }
  }


Reply via email to