---
src/qemu/qemu_hostdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 896ad9b..ba6dadd 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -511,7 +511,8 @@ int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
dev = pciDeviceListGet(pcidevs, i);
activeDev = pciDeviceListFind(driver->activePciHostdevs, dev);
- pciDeviceSetUsedBy(activeDev, name);
+ if (activeDev)
+ pciDeviceSetUsedBy(activeDev, name);
}
/* Loop 8: Now set the original states for hostdev def */
--
1.7.11.7