diff --git a/hw/etraxfs.c b/hw/etraxfs.c index 4f93cd81c3afce0c389a9b450ced300bf6772f49..2f6e2ee8da5788a90ba175770b5be3d445e2c07b 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);