From nobody Tue Feb 10 01:31:25 2026 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.zoho.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 1493103226125939.2845992557901; Mon, 24 Apr 2017 23:53:46 -0700 (PDT) Received: from localhost ([::1]:47328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2uM4-0004vl-Tw for importer@patchew.org; Tue, 25 Apr 2017 02:53:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2uKc-0003yO-Ue for qemu-devel@nongnu.org; Tue, 25 Apr 2017 02:52:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2uKZ-0006KW-TK for qemu-devel@nongnu.org; Tue, 25 Apr 2017 02:52:15 -0400 Received: from 6.mo7.mail-out.ovh.net ([188.165.39.218]:48319) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2uKZ-0006JA-Mw for qemu-devel@nongnu.org; Tue, 25 Apr 2017 02:52:11 -0400 Received: from player788.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 4BEA54DB79 for ; Tue, 25 Apr 2017 08:52:10 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: clg@kaod.org) by player788.ha.ovh.net (Postfix) with ESMTPSA id 212FE18007F; Tue, 25 Apr 2017 08:52:04 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Corey Minyard Date: Tue, 25 Apr 2017 08:51:41 +0200 Message-Id: <1493103101-25165-3-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493103101-25165-1-git-send-email-clg@kaod.org> References: <1493103101-25165-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17445256110779829176 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedrgedugdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 188.165.39.218 Subject: [Qemu-devel] [PATCH 2/2] ipmi: don't try to open a NULL filename 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: Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , qemu-devel@nongnu.org, "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currenlty, the code relies on the fact that open() handles NULL filenames but that can cause an error with new clang: hw/core/loader.c:67:15: runtime error: null pointer passed as argument 1, which is declared to never be null Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Eric Blake --- hw/ipmi/ipmi_bmc_sim.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 155561d06614..277c28cb40ed 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1899,6 +1899,10 @@ static void ipmi_fru_init(IPMIFru *fru) int fsize; int size =3D 0; =20 + if (!fru->filename) { + goto out; + } + fsize =3D get_image_size(fru->filename); if (fsize > 0) { size =3D QEMU_ALIGN_UP(fsize, fru->areasize); @@ -1910,6 +1914,7 @@ static void ipmi_fru_init(IPMIFru *fru) } } =20 +out: if (!fru->data) { /* give one default FRU */ size =3D fru->areasize; --=20 2.7.4