> +int virtio_gpu_update_dmabuf(VirtIOGPU *g, > + uint32_t scanout_id, > + struct virtio_gpu_simple_resource *res, > + struct virtio_gpu_framebuffer *fb) > +{ > + struct virtio_gpu_scanout *scanout = &g->parent_obj.scanout[scanout_id]; > + VGPUDMABuf *new_primary, *old_primary; > + > + new_primary = virtio_gpu_create_dmabuf(g, scanout_id, res, fb); > + if (!new_primary) { > + return -EINVAL; > + } > + > + if (g->dmabuf.primary) { > + old_primary = g->dmabuf.primary; > + } > + > + g->dmabuf.primary = new_primary; > + qemu_console_resize(scanout->con, > + new_primary->buf.width, > + new_primary->buf.height); > + dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf); > + > + if (old_primary) { > + virtio_gpu_free_dmabuf(g, old_primary); > + } > + > + return 0; > +}
../../hw/display/virtio-gpu-udmabuf.c: In function ‘virtio_gpu_update_dmabuf’: /home/kraxel/projects/qemu/include/qemu/queue.h:456:62: error: ‘old_primary’ may be used uninitialized in this function [-Werror=maybe-uninitialized] take care, Gerd