qemu: Check valid activeDev before calling pciDeviceSetUsedBy

This commit is contained in:
John Ferlan 2013-01-17 14:17:11 -05:00 committed by Peter Krempa
parent 55599102b4
commit e44d240092
1 changed files with 2 additions and 1 deletions

View File

@ -511,7 +511,8 @@ int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
dev = pciDeviceListGet(pcidevs, i); dev = pciDeviceListGet(pcidevs, i);
activeDev = pciDeviceListFind(driver->activePciHostdevs, dev); activeDev = pciDeviceListFind(driver->activePciHostdevs, dev);
pciDeviceSetUsedBy(activeDev, name); if (activeDev)
pciDeviceSetUsedBy(activeDev, name);
} }
/* Loop 8: Now set the original states for hostdev def */ /* Loop 8: Now set the original states for hostdev def */