From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnQGe-0006nz-Ug for qemu-devel@nongnu.org; Fri, 23 Sep 2016 09:11:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnQGb-00058s-Kc for qemu-devel@nongnu.org; Fri, 23 Sep 2016 09:11:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnQGb-000582-EO for qemu-devel@nongnu.org; Fri, 23 Sep 2016 09:11:49 -0400 Date: Fri, 23 Sep 2016 14:11:47 +0100 From: Stefan Hajnoczi Message-ID: <20160923131147.GM8221@stefanha-x1.localdomain> References: <147447700612.30952.9420141963781948805.stgit@bahia> <147447705731.30952.2850028415240858240.stgit@bahia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XlS4q8O07AKt4+K1" Content-Disposition: inline In-Reply-To: <147447705731.30952.2850028415240858240.stgit@bahia> Subject: Re: [Qemu-devel] [PATCH v2 6/9] virtio-net: handle virtio_net_receive() errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: qemu-devel@nongnu.org, Kevin Wolf , "Michael S. Tsirkin" , Jason Wang , Max Reitz , "Aneesh Kumar K.V" , Cornelia Huck , Paolo Bonzini --XlS4q8O07AKt4+K1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 21, 2016 at 06:57:37PM +0200, Greg Kurz wrote: > if (elem->in_num < 1) { > - error_report("virtio-net receive queue contains no in buffers"); > - exit(1); > + virtio_error(vdev, > + "virtio-net receive queue contains no in buffers"); > + return -1; Missing detach and free to avoid leaking elem. --XlS4q8O07AKt4+K1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJX5SoTAAoJEJykq7OBq3PIXQwH/0xUZch2eds9x31n6MYHkzvt u8wQ3/cLqt4sen0mn9dxzWcGUs9RpEPrDZDvv8X25DUEjCRQ2nQltEg/QqXbv8C+ cawGwmxeiPXDBoILJtFfPvPt+dLKqzUt2hew1S2PUYfSXpe2QuqQ0mPB4M5tdw94 uUbvJeZVRBwFlMDlvFZ0chvamCkMGAHJm6P3jiVjv+WUiziBCCfALG7vDjrQqoMD fi8hNSIsIh7GPK6356+aCxJHp0+Z8N6fhGihNL+2qE8pxCoEHl9Ia83/7kW+w/yB aE925cpfgPFW32uEDmQeoyPpZ8nw6kKBR9XHut1aZGR6OTWWq2tYmGhFGBDkIjE= =JFo8 -----END PGP SIGNATURE----- --XlS4q8O07AKt4+K1--