aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-09-09 17:06:02 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-09-15 10:29:48 +1000
commit8f68760561abf90156456fec6ad55c3b2a066d46 (patch)
treea04dfcdd1b690f6e75c1d985eee1e869e5860f3a /hw/ppc
parentc86c1affaec4bfa82eac226965e4be21fc44d538 (diff)
spapr_pci: drop useless check in spapr_phb_vfio_get_loc_code()
g_strdup_printf() either returns a non-null pointer, or aborts if it failed to allocate memory. Signed-off-by: Greg Kurz <groug@kaod.org> [dwg: Grammatical fix to commit message] Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index d7880f257a..ef982f2ef3 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;