summaryrefslogtreecommitdiffstats
path: root/hw/spapr.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/spapr.c')
-rw-r--r--hw/spapr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/spapr.c b/hw/spapr.c
index 21c261b..d80b792 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -328,14 +328,11 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
continue;
}
- if (asprintf(&nodename, "%s@%x", modelname, index) < 0) {
- fprintf(stderr, "Allocation failure\n");
- exit(1);
- }
+ nodename = g_strdup_printf("%s@%x", modelname, index);
_FDT((fdt_begin_node(fdt, nodename)));
- free(nodename);
+ g_free(nodename);
_FDT((fdt_property_cell(fdt, "reg", index)));
_FDT((fdt_property_string(fdt, "device_type", "cpu")));
OpenPOWER on IntegriCloud