From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bStNg-0005Qj-W3 for qemu-devel@nongnu.org; Thu, 28 Jul 2016 18:02:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bStNa-0003pi-Vv for qemu-devel@nongnu.org; Thu, 28 Jul 2016 18:02:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bStNa-0003pe-NM for qemu-devel@nongnu.org; Thu, 28 Jul 2016 18:02:10 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07D94C057FA6 for ; Thu, 28 Jul 2016 22:02:10 +0000 (UTC) References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-21-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <579A80E1.9050104@redhat.com> Date: Thu, 28 Jul 2016 16:02:09 -0600 MIME-Version: 1.0 In-Reply-To: <20160728143808.13707-21-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EaLw6FGOBowA8FxIt7uVfvvbffXDF9n8X" Subject: Re: [Qemu-devel] [PATCH v2 20/37] char: free MuxDriver when closing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EaLw6FGOBowA8FxIt7uVfvvbffXDF9n8X From: Eric Blake To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Message-ID: <579A80E1.9050104@redhat.com> Subject: Re: [PATCH v2 20/37] char: free MuxDriver when closing References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-21-marcandre.lureau@redhat.com> In-Reply-To: <20160728143808.13707-21-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/28/2016 08:37 AM, marcandre.lureau@redhat.com wrote: > From: Marc-Andr=C3=A9 Lureau >=20 > Similarly to other chr_close callbacks, free char type specific data. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > qemu-char.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/qemu-char.c b/qemu-char.c > index 6ed6dd6..e276485 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -786,6 +786,14 @@ static GSource *mux_chr_add_watch(CharDriverState = *s, GIOCondition cond) > return d->drv->chr_add_watch(d->drv, cond); > } > =20 > +static void mux_chr_close(struct CharDriverState *chr) > +{ > + MuxDriver *d =3D chr->opaque; > + > + /* is more cleanup needed? */ This comment is not re-assuring. > + g_free(d); > +} I looked at MuxDriver; the pointers in chr_can_read, chr_read, and chr_event are not allocated (since they are addresses of callback functions), ext_opaque is untouched (owned by the caller, not something we allocate), and drv is a back-reference; and there are no other pointers. So this looks correct. With the bad comment removed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EaLw6FGOBowA8FxIt7uVfvvbffXDF9n8X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXmoDhAAoJEKeha0olJ0Nqws4IAK+dMjCqVHyGzefPuLkv5Brp 3DYyA0qAt9yXD6JBeLV6KTGxFnhd/48yIh1j2auPpkC0xLQa6u7X78moaBZAecFp IXnYzaOggJRmR/d/GnN2bfbdz/HVBELdSaVxGCTMbx9G7ZHPehGbMFQJ5UsdocH3 tF7XrExumIW9Iblm2gwAXyR8pADsIjF0B7p5AHPAs5GS0nStVQJzJNc2dpJQtC+0 BbHqmD1p0ukZAZKjOKa1UsxZ8WdblFiAZCG993G9HpFb5KoMaGGxsbnfS5SOGdXV 9rQdKTtfALQxMHlF2NXQ577poDKgUtYSg3OzwWxuWK5kKGJ65c/A376QkxoKZRw= =NqxW -----END PGP SIGNATURE----- --EaLw6FGOBowA8FxIt7uVfvvbffXDF9n8X--