From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8zEV-0000zQ-Oc for qemu-devel@nongnu.org; Mon, 03 May 2010 13:15:03 -0400 Received: from [140.186.70.92] (port=52359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8zEH-0000pT-Gi for qemu-devel@nongnu.org; Mon, 03 May 2010 13:15:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8zDl-0001Er-Hj for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:20 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:64031) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8zDl-0001Ds-DK for qemu-devel@nongnu.org; Mon, 03 May 2010 13:14:17 -0400 Received: by mail-gy0-f173.google.com with SMTP id 5so1255606gyd.4 for ; Mon, 03 May 2010 10:14:17 -0700 (PDT) Message-ID: <4BDF0465.30300@codemonkey.ws> Date: Mon, 03 May 2010 12:14:13 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-serial: Fix check for 'assert'; prevent NULL derefs References: <1272626035-14416-1-git-send-email-amit.shah@redhat.com> In-Reply-To: <1272626035-14416-1-git-send-email-amit.shah@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Juan Quintela On 04/30/2010 06:13 AM, Amit Shah wrote: > In the flush_queued_data() function, we expect port to be valid. Assert > only for port and not port || discard. > > Reported-by: Juan Quintela > Signed-off-by: Amit Shah > Applied. Thanks. Regards, Anthony Liguori > --- > hw/virtio-serial-bus.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c > index 97694d5..3ce95e8 100644 > --- a/hw/virtio-serial-bus.c > +++ b/hw/virtio-serial-bus.c > @@ -137,7 +137,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, > > static void flush_queued_data(VirtIOSerialPort *port, bool discard) > { > - assert(port || discard); > + assert(port); > > do_flush_queued_data(port, port->ovq,&port->vser->vdev, discard); > } >