Skip to contentSkip to conversation

s390: Fix buggy assignment

PATCH In review Stefan Weil 2 participants 2 messages Dec 14, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: Fix buggy assignment

nd->model keeps dynamically allocated model names. So casting of a constant string is wrong here.

---
 hw/s390-virtio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/s390-virtio.c +1 -1
index b567886..b57fa9c 100644
@@ -209,7 +209,7 @@ static void s390_init(ram_addr_t ram_size,
         DeviceState *dev;
 
         if (!nd->model) {
-            nd->model = (char*)"virtio";
+            nd->model = qemu_strdup("virtio");
         }
 
         if (strcmp(nd->model, "virtio")) {
Signature · 1 line
1.6.5