From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zguie-0004gm-Qk for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZguiZ-0002Ja-6E for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:13:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZguiZ-0002JT-1I for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:13:15 -0400 Date: Tue, 29 Sep 2015 16:13:08 +0300 From: "Michael S. Tsirkin" Message-ID: <20150929161248-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> <20150924131554-mutt-send-email-mst@redhat.com> <1443186899.1789.4.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443186899.1789.4.camel@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 Fri, Sep 25, 2015 at 03:14:59PM +0200, Gerd Hoffmann wrote: > On Do, 2015-09-24 at 13:16 +0300, Michael S. Tsirkin wrote: > > 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. > > It's for symmetry reasons: virtio_gpu_create_mapping_iov() allocates it > so virtio_gpu_cleanup_mapping_iov() should free it, otherwise it's easy > to miss a free() needed and leak memory. > > cheers, > Gerd > Makes sense. Pls include this info in the commit log.