Commit 5652ef78d1295c149cdbe68db09806ec7d266083

Authored by aurel32
1 parent e5d01b06

mips, ppc: make sure nd->model is always defined

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6261 c046a42c-6fe2-441c-8c8c-71466251a162
hw/mips_r4k.c
... ... @@ -248,8 +248,10 @@ void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size,
248 248 vga_ram_size);
249 249  
250 250 if (nd_table[0].vlan) {
251   - if (nd_table[0].model == NULL
252   - || strcmp(nd_table[0].model, "ne2k_isa") == 0) {
  251 + if (nd_table[i].model == NULL) {
  252 + nd_table[i].model = "ne2k_isa";
  253 + }
  254 + if (strcmp(nd_table[0].model, "ne2k_isa") == 0) {
253 255 isa_ne2000_init(0x300, i8259[9], &nd_table[0]);
254 256 } else if (strcmp(nd_table[0].model, "?") == 0) {
255 257 fprintf(stderr, "qemu: Supported NICs: ne2k_isa\n");
... ...
hw/ppc_prep.c
... ... @@ -671,8 +671,10 @@ static void ppc_prep_init (ram_addr_t ram_size, int vga_ram_size,
671 671 if (nb_nics1 > NE2000_NB_MAX)
672 672 nb_nics1 = NE2000_NB_MAX;
673 673 for(i = 0; i < nb_nics1; i++) {
674   - if (nd_table[i].model == NULL
675   - || strcmp(nd_table[i].model, "ne2k_isa") == 0) {
  674 + if (nd_table[i].model == NULL) {
  675 + nd_table[i].model = "ne2k_isa";
  676 + }
  677 + if (strcmp(nd_table[i].model, "ne2k_isa") == 0) {
676 678 isa_ne2000_init(ne2000_io[i], i8259[ne2000_irq[i]], &nd_table[i]);
677 679 } else {
678 680 pci_nic_init(pci_bus, &nd_table[i], -1);
... ...