From nobody Tue Nov 4 07:11:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504969789453712.6084770828332; Sat, 9 Sep 2017 08:09:49 -0700 (PDT) Received: from localhost ([::1]:49887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqhOG-0001nw-HP for importer@patchew.org; Sat, 09 Sep 2017 11:09:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqhKh-0007cy-5q for qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqhKg-0005ut-Ce for qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:07 -0400 Received: from 6.mo177.mail-out.ovh.net ([46.105.51.249]:49645) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqhKg-0005td-5v for qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:06 -0400 Received: from player714.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 3297274BCE for ; Sat, 9 Sep 2017 17:06:05 +0200 (CEST) Received: from [192.168.0.243] (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player714.ha.ovh.net (Postfix) with ESMTPA id F13E23C0073; Sat, 9 Sep 2017 17:06:02 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Sat, 09 Sep 2017 17:06:02 +0200 Message-ID: <150496956243.9654.5568893219758334324.stgit@bahia> In-Reply-To: <150496954641.9654.1998704077006846521.stgit@bahia> References: <150496954641.9654.1998704077006846521.stgit@bahia> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 242349956608137555 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrfeeigdekjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.51.249 Subject: [Qemu-devel] [PATCH 1/5] spapr_pci: drop useless check in spapr_phb_vfio_get_loc_code() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 g_strdup_printf() either returns a non-null pointer, either aborts if it failed to allocate memory. Signed-off-by: Greg Kurz Acked-by: Philippe Mathieu-Daud=C3=A9 --- 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 =3D 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 =3D 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;