diff options
author | blueswir1 | 2009-01-10 15:38:00 +0100 |
---|---|---|
committer | blueswir1 | 2009-01-10 15:38:00 +0100 |
commit | 6ea52595474e16888d10eec310b0d156f8bbabc1 (patch) | |
tree | 87fef9c73a565abef8ea8218939cddb1ffe03cc3 /hw/sun4m.c | |
parent | Add EBUS bridge (diff) | |
download | qemu-6ea52595474e16888d10eec310b0d156f8bbabc1.tar.gz qemu-6ea52595474e16888d10eec310b0d156f8bbabc1.tar.xz qemu-6ea52595474e16888d10eec310b0d156f8bbabc1.zip |
Fix segfault
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6267 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index e6a538a9f3..b7bd51f39d 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -533,8 +533,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n"); @@ -1325,8 +1326,9 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size, tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n"); @@ -1540,8 +1542,9 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size, tcx_init(ds, hwdef->tcx_base, phys_ram_base + tcx_offset, tcx_offset, hwdef->vram_size, graphic_width, graphic_height, graphic_depth); - if (nd_table[0].model == NULL - || strcmp(nd_table[0].model, "lance") == 0) { + if (nd_table[0].model == NULL) + nd_table[0].model = "lance"; + if (strcmp(nd_table[0].model, "lance") == 0) { lance_init(&nd_table[0], hwdef->le_base, ledma, *ledma_irq, le_reset); } else if (strcmp(nd_table[0].model, "?") == 0) { fprintf(stderr, "qemu: Supported NICs: lance\n"); |