提交 9eee9a5d 编写于 作者: E edgar_igl

ETRAX-FS: Fix a segfault if pflash drive not found.

drive_get_index() returns -1 if a drive isn't found; don't
use -1 to index drives_table.
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5719 c046a42c-6fe2-441c-8c8c-71466251a162
上级 10781c09
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册