[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] qdev: fix nic/id windup.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 2/2] qdev: fix nic/id windup. |
Date: |
Thu, 9 Jul 2009 15:02:09 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/pci.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 3410ea7..cc4882e 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -821,7 +821,8 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char
*default_model,
for (i = 0; pci_nic_models[i]; i++) {
if (strcmp(nd->model, pci_nic_models[i]) == 0) {
dev = pci_create(pci_nic_names[i], devaddr);
- snprintf(dev->id, sizeof(dev->id), "%s", nd->id);
+ if (nd->id)
+ snprintf(dev->id, sizeof(dev->id), "%s", nd->id);
dev->nd = nd;
qdev_init(dev);
nd->private = dev;
--
1.6.2.5