From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0jFg-0001rJ-MZ for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:57:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0jFe-0001qo-Sr for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:57:20 -0500 Received: from [199.232.76.173] (port=51053 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0jFe-0001ql-Nv for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:57:18 -0500 Received: from bart.se.axis.com ([195.60.68.10]:54611) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0jFe-00064w-9R for qemu-devel@nongnu.org; Thu, 13 Nov 2008 15:57:18 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id 06868641DC for ; Thu, 13 Nov 2008 21:57:01 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id E0F53641D2 for ; Thu, 13 Nov 2008 21:57:00 +0100 (CET) Date: Thu, 13 Nov 2008 21:57:00 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] Re: [PATCH 3/3] cris: fix a segfault if pflash drive not found Message-ID: <20081113205700.GC17711@edgar.se.axis.com> 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> <491C81E6.9070108@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <491C81E6.9070108@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Mark McLoughlin , qemu-devel@nongnu.org, "Edgar E. Iglesias" On Thu, Nov 13, 2008 at 01:37:10PM -0600, Anthony Liguori wrote: > 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? Look OK, I'll apply it later tonight. Thanks > > 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); >> > >