Hi On Wed, May 5, 2021 at 12:03 PM P J P wrote: > +-- On Tue, 4 May 2021, Li Qiang wrote --+ > | diff --git a/contrib/vhost-user-gpu/virgl.c > b/contrib/vhost-user-gpu/virgl.c > | index c669d73a1d..a16a311d80 100644 > | --- a/contrib/vhost-user-gpu/virgl.c > | +++ b/contrib/vhost-user-gpu/virgl.c > | @@ -287,8 +287,11 @@ virgl_resource_attach_backing(VuGpu *g, > | return; > | } > | > | - virgl_renderer_resource_attach_iov(att_rb.resource_id, > | + ret = virgl_renderer_resource_attach_iov(att_rb.resource_id, > | res_iovs, att_rb.nr_entries); > | + if (ret != 0) { > | + g_free(res_iovs); > | + } > | } > > * Similar to earlier, > hw/display/virtio-gpu-3d.c:virgl_resource_attach_backing() calls > 'virtio_gpu_cleanup_mapping_iov' > > * should it be same for vhost-user-gpu? > > > Good question, that's also what you did when you fixed it for virtio-gpu in: commit 33243031dad02d161225ba99d782616da133f689 Author: Li Qiang Date: Thu Dec 29 03:11:26 2016 -0500 virtio-gpu-3d: fix memory leak in resource attach backing Btw, for each patch, it would be nice to have a reference to the original fix in virtio-gpu. Thanks!