From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0i0D-0004aY-Sa for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:37:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0i0B-0004WY-RW for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:37:17 -0500 Received: from [199.232.76.173] (port=49200 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0i0B-0004W9-LC for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:37:15 -0500 Received: from yx-out-1718.google.com ([74.125.44.152]:1698) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0i0B-0006xz-FQ for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:37:15 -0500 Received: by yx-out-1718.google.com with SMTP id 3so447901yxi.82 for ; Thu, 13 Nov 2008 11:37:14 -0800 (PST) Message-ID: <491C81E6.9070108@codemonkey.ws> Date: Thu, 13 Nov 2008 13:37:10 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <> <1226594526-1855-1-git-send-email-markmc@redhat.com> <1226594526-1855-2-git-send-email-markmc@redhat.com> <1226594526-1855-3-git-send-email-markmc@redhat.com> In-Reply-To: <1226594526-1855-3-git-send-email-markmc@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/3] cris: fix a segfault if pflash drive not found Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: "Edgar E. Iglesias" , qemu-devel@nongnu.org Mark McLoughlin wrote: > drive_get_index() returns -1 if a drive isn't found; don't > use -1 to index drives_table. > Looks fine to me. Edgar? Regards, Anthony Liguori > Signed-off-by: Mark McLoughlin > --- > hw/etraxfs.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/etraxfs.c b/hw/etraxfs.c > index 4f93cd8..2f6e2ee 100644 > --- a/hw/etraxfs.c > +++ b/hw/etraxfs.c > @@ -83,7 +83,7 @@ void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size, > phys_flash = qemu_ram_alloc(FLASH_SIZE); > i = drive_get_index(IF_PFLASH, 0, 0); > pflash_cfi02_register(0x0, phys_flash, > - drives_table[i].bdrv, (64 * 1024), > + i != -1 ? drives_table[i].bdrv : NULL, (64 * 1024), > FLASH_SIZE >> 16, > 1, 2, 0x0000, 0x0000, 0x0000, 0x0000, > 0x555, 0x2aa); >