mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Properly check the return value of CCWAddressAsString
It returns NULL on failure. Checking if the negation of it is less than zero makes no sense. (Found by coverity after moving the code) In another case, the return value wasn't checked at all.
This commit is contained in:
parent
b2626755d3
commit
3fe9d75ab6
@ -614,7 +614,7 @@ virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
|
||||
goto cleanup;
|
||||
}
|
||||
} else if (autoassign && !dev->addr.ccw.assigned) {
|
||||
if (!(addr = virDomainCCWAddressAsString(&addrs->next)) < 0)
|
||||
if (!(addr = virDomainCCWAddressAsString(&addrs->next)))
|
||||
goto cleanup;
|
||||
|
||||
while (virHashLookup(addrs->defined, addr)) {
|
||||
@ -624,7 +624,8 @@ virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(addr);
|
||||
addr = virDomainCCWAddressAsString(&addrs->next);
|
||||
if (!(addr = virDomainCCWAddressAsString(&addrs->next)))
|
||||
goto cleanup;
|
||||
}
|
||||
dev->addr.ccw = addrs->next;
|
||||
dev->addr.ccw.assigned = true;
|
||||
|
Loading…
Reference in New Issue
Block a user