virDomainCCWAddressSetCreate: virHashNew cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-05 16:53:01 +02:00
parent 1670b9116a
commit f6252cf6b0

View File

@ -1388,8 +1388,7 @@ virDomainCCWAddressSetCreate(void)
addrs = g_new0(virDomainCCWAddressSet, 1);
if (!(addrs->defined = virHashNew(g_free)))
goto error;
addrs->defined = virHashNew(g_free);
/* must use cssid = 0xfe (254) for virtio-ccw devices */
addrs->next.cssid = 254;
@ -1397,10 +1396,6 @@ virDomainCCWAddressSetCreate(void)
addrs->next.devno = 0;
addrs->next.assigned = 0;
return addrs;
error:
virDomainCCWAddressSetFree(addrs);
return NULL;
}