From patchwork Wed Oct 24 05:12:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 10654175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CC9813A9 for ; Wed, 24 Oct 2018 05:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DBD42A5D3 for ; Wed, 24 Oct 2018 05:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 205AA2A628; Wed, 24 Oct 2018 05:14:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB14E2A5D3 for ; Wed, 24 Oct 2018 05:14:37 +0000 (UTC) Received: from localhost ([::1]:45819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFBV6-0005bu-8Q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Oct 2018 01:14:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFBU8-00058k-TN for qemu-devel@nongnu.org; Wed, 24 Oct 2018 01:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFBSn-0001R1-OX for qemu-devel@nongnu.org; Wed, 24 Oct 2018 01:12:17 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:44553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gFBSj-0001Cj-9y for qemu-devel@nongnu.org; Wed, 24 Oct 2018 01:12:11 -0400 Received: by mail-pg1-x542.google.com with SMTP id w3-v6so1743712pgs.11 for ; Tue, 23 Oct 2018 22:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=KOrBWALrVtgm1DzQABdpD2wC1VS6Eyh0r4lGGiJwdNU=; b=FZ5wgHSbS9RBsdzNXgsZRKnfuqa6VYkkP7+dZnQQO3x3giVXeyJjQY8b8gEm+OqbhO prU6BNZht91UFCTfoTAq1KL4drhwq/eg1JKPrAUCmr+kpIuatfQY4YrP1BXB6VRALx36 fobUoSlaQEmKwXs3Vzp6EaFlV+ugh9A22JKAXRhnhrvXNMHHCDMyOjFht/nCv4nLWxz6 ZKlE52Pl8aIjvVSY5ThmD9jdKFoA0puuAsO25aUjmwOL13MhzhvLRglg6VEENmk34LRO cwp0yQzqNrV2wu22y/+fyvANoglqp7kT3WAd3SFZ6IUJaGYkclqAY3SIGYzhktneb0fy O8tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KOrBWALrVtgm1DzQABdpD2wC1VS6Eyh0r4lGGiJwdNU=; b=XHaink6NREAG3YeguE59T99Ik+tZn6kY/SV/TXYGwAFoTX3pNDQjGHKOk1XlIvmqoK b2kaJ3Qvo2j5CNcNBsaxwtiN3PGsfMtscSwnEDPIIM9X3UV7f9MdEyKTOLqGwBhjhlnG iV3SvlssJjeCPw0Bkf1GU9s8F/SYFX0LCTB3vXxlsYea83Saz/vyb7vyMaNSmuzRmH7X FbzxH/qtAahlOqGiiE5UyF9D0QK5v3NuJdVgxc8J4RLwRIqHeOI47WTK7RuonQmNl0AR OAEGFDtvY+cL5pWcx8jumVz1snqCJ3PSpbaHBZ8xdm3dN7OP3Uq7gbfFQ/VywNyYPj/p Q2hQ== X-Gm-Message-State: AGRZ1gKdCRzz5o8HjbkNaOoFnd2iEYzAnlXLHmg50JfmhPShKSbVhpkc VhKX5SB1nh2ApQLfuHUdWF0= X-Google-Smtp-Source: AJdET5cQiBmXb2+18ps2U0YD4+doVtbiqX7vJdGbyDCcYanlPT/CH7f+oIMgF1J3OHnEwsjMuUy9eA== X-Received: by 2002:aa7:8001:: with SMTP id j1-v6mr1194298pfi.73.1540357926817; Tue, 23 Oct 2018 22:12:06 -0700 (PDT) Received: from localhost.localdomain.localdomain ([103.65.40.100]) by smtp.gmail.com with ESMTPSA id p7-v6sm4512982pfb.101.2018.10.23.22.12.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 22:12:06 -0700 (PDT) From: Li Qiang To: lersek@redhat.com, peter.maydell@linaro.org, pbonzini@redhat.com Date: Tue, 23 Oct 2018 22:12:01 -0700 Message-Id: <1540357921-4199-1-git-send-email-liq3ea@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed 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: Li Qiang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Also remove unnecessary 'res' variable. Signed-off-by: Li Qiang Reviewed-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daudé --- hw/nvram/fw_cfg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 946f765..f4a52d8 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep, int *file_typep) { GError *err = NULL; - gboolean res; gchar *content; int file_type; unsigned int filehead; int bmp_bpp; - res = g_file_get_contents(filename, &content, file_sizep, &err); - if (res == FALSE) { - error_report("failed to read splash file '%s'", filename); + if (!g_file_get_contents(filename, &content, file_sizep, &err)) { + error_report("failed to read splash file '%s', %s", + filename, err->message); g_error_free(err); return NULL; }