diff options
author | Stefan Weil | 2013-01-16 18:22:29 +0100 |
---|---|---|
committer | Anthony Liguori | 2013-01-16 19:02:30 +0100 |
commit | 4ecf8aa5a06a830b05c035a5d6184bf991931d20 (patch) | |
tree | bb284f1cdf84ea500875745a01582aa49f00309a /hw/spapr.c | |
parent | Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405 (diff) | |
download | qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.tar.gz qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.tar.xz qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.zip |
pseries: Replace non-portable asprintf by g_strdup_printf
g_strdup_printf already handles OOM errors, so some error handling in
QEMU code can be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/spapr.c')
-rw-r--r-- | hw/spapr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/spapr.c b/hw/spapr.c index 21c261be4a..d80b792b37 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"))); |