mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
conf: Fix crash in virDomainDefCompatibleDevice
Commit id 'edae027c' blindly assumed that the passed @oldDev parameter would not be NULL when calling virDomainDeviceGetInfo; however, commit id 'b6a264e8' passed NULL for AttachDevice callers under the premise that there wouldn't be a device to check/update against. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
7a32bedffc
commit
5535856f0e
@ -27417,9 +27417,12 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
|
||||
{
|
||||
virDomainCompatibleDeviceData data = {
|
||||
.newInfo = virDomainDeviceGetInfo(dev),
|
||||
.oldInfo = virDomainDeviceGetInfo(oldDev),
|
||||
.oldInfo = NULL,
|
||||
};
|
||||
|
||||
if (oldDev)
|
||||
data.oldInfo = virDomainDeviceGetInfo(oldDev);
|
||||
|
||||
if (!virDomainDefHasUSB(def) &&
|
||||
def->os.type != VIR_DOMAIN_OSTYPE_EXE &&
|
||||
virDomainDeviceIsUSB(dev)) {
|
||||
|
Loading…
Reference in New Issue
Block a user