mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cpu_ppc64.c: modernize ppc64VendorParse()
Use g_autoptr() in virCPUppc64VendorPtr and remove the now uneeded 'cleanup' label. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
339525a68d
commit
a79ba15546
@ -279,8 +279,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED,
|
||||
void *data)
|
||||
{
|
||||
struct ppc64_map *map = data;
|
||||
virCPUppc64VendorPtr vendor;
|
||||
int ret = -1;
|
||||
g_autoptr(virCPUppc64Vendor) vendor = NULL;
|
||||
|
||||
if (VIR_ALLOC(vendor) < 0)
|
||||
return -1;
|
||||
@ -290,17 +289,13 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED,
|
||||
if (ppc64VendorFind(map, vendor->name)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("CPU vendor %s already defined"), vendor->name);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
ppc64VendorFree(vendor);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user