[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 1/5] spapr_pci: drop useless check in spapr_phb_vfio_g
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 1/5] spapr_pci: drop useless check in spapr_phb_vfio_get_loc_code() |
Date: |
Sat, 09 Sep 2017 17:06:02 +0200 |
User-agent: |
StGit/0.17.1-46-g6855-dirty |
g_strdup_printf() either returns a non-null pointer, either aborts
if it failed to allocate memory.
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr_pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index d7880f257aa1..ef982f2ef370 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -766,7 +766,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState
*sphb, PCIDevice *pdev)
/* Construct the path of the file that will give us the DT location */
path = g_strdup_printf("/sys/bus/pci/devices/%s/devspec", host);
g_free(host);
- if (!path || !g_file_get_contents(path, &buf, NULL, NULL)) {
+ if (!g_file_get_contents(path, &buf, NULL, NULL)) {
goto err_out;
}
g_free(path);
@@ -774,7 +774,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState
*sphb, PCIDevice *pdev)
/* Construct and read from host device tree the loc-code */
path = g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
g_free(buf);
- if (!path || !g_file_get_contents(path, &buf, NULL, NULL)) {
+ if (!g_file_get_contents(path, &buf, NULL, NULL)) {
goto err_out;
}
return buf;
- [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 <=
- [Qemu-ppc] [PATCH 2/5] spapr_pci: drop useless check in spapr_populate_pci_child_dt(), Greg Kurz, 2017/09/09
- [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