mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
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>
This commit is contained in:
parent
8f68760561
commit
d049bde69d
1 changed files with 1 additions and 5 deletions
|
@ -1282,12 +1282,8 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,
|
||||||
pci_find_device_name((ccode >> 16) & 0xff,
|
pci_find_device_name((ccode >> 16) & 0xff,
|
||||||
(ccode >> 8) & 0xff,
|
(ccode >> 8) & 0xff,
|
||||||
ccode & 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);
|
err = fdt_setprop_string(fdt, offset, "ibm,loc-code", buf);
|
||||||
g_free(buf);
|
g_free(buf);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue