diff options
author | Greg Kurz <groug@kaod.org> | 2017-09-09 17:06:10 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-09-15 10:29:48 +1000 |
commit | d049bde69d8ab3dfa4edeee48896088ae9feb693 (patch) | |
tree | ffb93ab5e11ebc428ae2c2eac903f739c788a8b1 /hw/ppc/spapr_pci.c | |
parent | 8f68760561abf90156456fec6ad55c3b2a066d46 (diff) |
spapr_pci: drop useless check in spapr_populate_pci_child_dt()
spapr_phb_get_loc_code() either returns a non-null pointer, or aborts
if g_strdup_printf() failed to allocate memory.
Signed-off-by: Greg Kurz <groug@kaod.org>
[dwg: Grammatical fix to commit message]
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r-- | hw/ppc/spapr_pci.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index ef982f2ef3..cd8efb1812 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1282,12 +1282,8 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset, pci_find_device_name((ccode >> 16) & 0xff, (ccode >> 8) & 0xff, ccode & 0xff))); - buf = spapr_phb_get_loc_code(sphb, dev); - if (!buf) { - error_report("Failed setting the ibm,loc-code"); - return -1; - } + buf = spapr_phb_get_loc_code(sphb, dev); err = fdt_setprop_string(fdt, offset, "ibm,loc-code", buf); g_free(buf); if (err < 0) { |