From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf3aL-0004lp-42 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 06:17:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf3aG-0000o9-4g for qemu-devel@nongnu.org; Thu, 24 Sep 2015 06:17:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf3aF-0000nX-On for qemu-devel@nongnu.org; Thu, 24 Sep 2015 06:16:59 -0400 Date: Thu, 24 Sep 2015 13:16:56 +0300 From: "Michael S. Tsirkin" Message-ID: <20150924131554-mutt-send-email-mst@redhat.com> References: <1443085502-596-1-git-send-email-kraxel@redhat.com> <1443085502-596-5-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443085502-596-5-git-send-email-kraxel@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 04/11] virtio-gpu: move iov free to virtio_gpu_cleanup_mapping_iov List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: David Airlie , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel@nongnu.org, Max Reitz On Thu, Sep 24, 2015 at 11:04:55AM +0200, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann It's easy to see this is what the patch does. But why? Some explanation in the commit log about why it's done, as opposed to what is done, would be better. > --- > hw/display/virtio-gpu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c > index a67d927..73bd9b6 100644 > --- a/hw/display/virtio-gpu.c > +++ b/hw/display/virtio-gpu.c > @@ -563,7 +563,6 @@ int virtio_gpu_create_mapping_iov(struct virtio_gpu_resource_attach_backing *ab, > __func__, ab->resource_id, i); > virtio_gpu_cleanup_mapping_iov(*iov, i); > g_free(ents); > - g_free(*iov); > *iov = NULL; > return -1; > } > @@ -580,12 +579,12 @@ void virtio_gpu_cleanup_mapping_iov(struct iovec *iov, uint32_t count) > cpu_physical_memory_unmap(iov[i].iov_base, iov[i].iov_len, 1, > iov[i].iov_len); > } > + g_free(iov); > } > > static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res) > { > virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt); > - g_free(res->iov); > res->iov = NULL; > res->iov_cnt = 0; > } > -- > 1.8.3.1