diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-01-16 18:22:29 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-16 12:02:30 -0600 |
commit | 4ecf8aa5a06a830b05c035a5d6184bf991931d20 (patch) | |
tree | bb284f1cdf84ea500875745a01582aa49f00309a /hw/spapr.c | |
parent | b8e76b35d47d03f6f9bb3a7455316aaed8b25795 (diff) | |
download | qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.zip qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.tar.gz qemu-4ecf8aa5a06a830b05c035a5d6184bf991931d20.tar.bz2 |
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
@@ -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"))); |