From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbULY-0006TW-KZ for qemu-devel@nongnu.org; Tue, 28 Jun 2011 05:12:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbULW-0005xW-Qb for qemu-devel@nongnu.org; Tue, 28 Jun 2011 05:12:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbULW-0005xA-CT for qemu-devel@nongnu.org; Tue, 28 Jun 2011 05:12:38 -0400 Date: Tue, 28 Jun 2011 14:42:25 +0530 From: Amit Shah Message-ID: <20110628091225.GA2664@amit-x200.redhat.com> References: <20110617155808.0f080bfc@doriath> <20110622041922.GA5789@amit-x200.redhat.com> <20110622095335.163b4950@doriath> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110622095335.163b4950@doriath> Subject: Re: [Qemu-devel] [PATCH v2] virtio-serial: Fix segfault on guest boot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel , mdroth@linux.vnet.ibm.com, Markus Armbruster On (Wed) 22 Jun 2011 [09:53:35], Luiz Capitulino wrote: > On Wed, 22 Jun 2011 09:49:22 +0530 > Amit Shah wrote: > > > > > > - port = find_port_by_id(vser, ldl_p(&gcpkt->id)); > > > - if (!port && cpkt.event != VIRTIO_CONSOLE_DEVICE_READY) > > > - return; > > > - > > > - info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info); > > > - > > > - switch(cpkt.event) { > > > - case VIRTIO_CONSOLE_DEVICE_READY: > > > + if (cpkt.event == VIRTIO_CONSOLE_DEVICE_READY) { > > > > What we lose after this re-arrangement is the check that port is NULL > > when this message is received. i.e., a guest bug where port is set to > > a valid value when this message arrives. (I think I pointed this out > > in a previous mail?) > > I'm not sure I follow you here, the current code doesn't return if > cpkt.event == VIRTIO_CONSOLE_DEVICE_READY: > > port = find_port_by_id(vser, ldl_p(&gcpkt->id)); > if (!port && cpkt.event != VIRTIO_CONSOLE_DEVICE_READY) > return; Ah; right. Anyway it's a small thing, nothing to be worried about. Amit