From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlKRK-0004aU-HG for qemu-devel@nongnu.org; Fri, 16 May 2014 11:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlKRF-0005o6-7P for qemu-devel@nongnu.org; Fri, 16 May 2014 11:52:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlKRE-0005mU-VB for qemu-devel@nongnu.org; Fri, 16 May 2014 11:52:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4GFqlGS007895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 16 May 2014 11:52:47 -0400 Message-ID: <5376344D.5080002@redhat.com> Date: Fri, 16 May 2014 17:52:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400255046-24481-1-git-send-email-armbru@redhat.com> <1400255046-24481-3-git-send-email-armbru@redhat.com> In-Reply-To: <1400255046-24481-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-scsi: Plug memory leak on virtio_scsi_push_event() error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Il 16/05/2014 17:44, Markus Armbruster ha scritto: > Spotted by Coverity. > > Signed-off-by: Markus Armbruster > --- > hw/scsi/virtio-scsi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index 1752193..14261fb 100644 > --- a/hw/scsi/virtio-scsi.c > +++ b/hw/scsi/virtio-scsi.c > @@ -498,7 +498,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, > uint32_t event, uint32_t reason) > { > VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s); > - VirtIOSCSIReq *req = virtio_scsi_pop_req(s, vs->event_vq); > + VirtIOSCSIReq *req; > VirtIOSCSIEvent *evt; > VirtIODevice *vdev = VIRTIO_DEVICE(s); > int in_size; > @@ -507,6 +507,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, > return; > } > > + req = virtio_scsi_pop_req(s, vs->event_vq); > if (!req) { > s->events_dropped = true; > return; > Cc: qemu-stable@nongnu.org