[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 2/5] spapr_pci: drop useless check in spapr_populate_p
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 2/5] spapr_pci: drop useless check in spapr_populate_pci_child_dt() |
Date: |
Sat, 09 Sep 2017 17:06:10 +0200 |
User-agent: |
StGit/0.17.1-46-g6855-dirty |
spapr_phb_get_loc_code() either returns a non-null pointer, either
aborts if g_strdup_printf() failed to allocate memory.
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr_pci.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index ef982f2ef370..cd8efb181223 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) {
- [Qemu-ppc] [PATCH 0/5] spapr_pci: various cleanups and improvements, Greg Kurz, 2017/09/09
- [Qemu-ppc] [PATCH 1/5] spapr_pci: drop useless check in spapr_phb_vfio_get_loc_code(), Greg Kurz, 2017/09/09
- [Qemu-ppc] [PATCH 2/5] spapr_pci: drop useless check in spapr_populate_pci_child_dt(),
Greg Kurz <=
- [Qemu-ppc] [PATCH 3/5] spapr_pci: use g_strdup_printf(), Greg Kurz, 2017/09/09
- [Qemu-ppc] [PATCH 4/5] spapr_pci: use the common _FDT() helper, Greg Kurz, 2017/09/09
- [Qemu-ppc] [PATCH 5/5] spapr_pci: handle FDT creation errors with _FDT(), Greg Kurz, 2017/09/09
- Re: [Qemu-ppc] [PATCH 0/5] spapr_pci: various cleanups and improvements, David Gibson, 2017/09/09
- Re: [Qemu-ppc] [PATCH 0/5] spapr_pci: various cleanups and improvements, David Gibson, 2017/09/10