All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grzegorz Uriasz <gorbak25@gmail.com>
To: qemu-devel@nongnu.org
Cc: artur@puzio.waw.pl, Stefano Stabellini <sstabellini@kernel.org>,
	Paul Durrant <paul@xen.org>,
	jakub@bartmin.ski, marmarek@invisiblethingslab.com,
	Grzegorz Uriasz <gorbak25@gmail.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	j.nowak26@student.uw.edu.pl, xen-devel@lists.xenproject.org
Subject: [PATCH 1/2] Fix undefined behaviour
Date: Tue, 28 Apr 2020 06:28:46 +0000	[thread overview]
Message-ID: <20200428062847.7764-2-gorbak25@gmail.com> (raw)
In-Reply-To: <20200428062847.7764-1-gorbak25@gmail.com>

Signed-off-by: Grzegorz Uriasz <gorbak25@gmail.com>
---
 hw/xen/xen_pt_load_rom.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c
index a50a80837e..9f100dc159 100644
--- a/hw/xen/xen_pt_load_rom.c
+++ b/hw/xen/xen_pt_load_rom.c
@@ -38,12 +38,12 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
     fp = fopen(rom_file, "r+");
     if (fp == NULL) {
         if (errno != ENOENT) {
-            error_report("pci-assign: Cannot open %s: %s", rom_file, strerror(errno));
+            warn_report("pci-assign: Cannot open %s: %s", rom_file, strerror(errno));
         }
         return NULL;
     }
     if (fstat(fileno(fp), &st) == -1) {
-        error_report("pci-assign: Cannot stat %s: %s", rom_file, strerror(errno));
+        warn_report("pci-assign: Cannot stat %s: %s", rom_file, strerror(errno));
         goto close_rom;
     }
 
@@ -59,10 +59,9 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
     memset(ptr, 0xff, st.st_size);
 
     if (!fread(ptr, 1, st.st_size, fp)) {
-        error_report("pci-assign: Cannot read from host %s", rom_file);
-        error_printf("Device option ROM contents are probably invalid "
-                     "(check dmesg).\nSkip option ROM probe with rombar=0, "
-                     "or load from file with romfile=\n");
+        warn_report("pci-assign: Cannot read from host %s", rom_file);
+        memory_region_unref(&dev->rom);
+        ptr = NULL;
         goto close_rom;
     }
 
-- 
2.26.1



  reply	other threads:[~2020-04-28  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28  6:28 [PATCH 0/2] Fix QEMU crashes when passing IGD to a guest VM under XEN Grzegorz Uriasz
2020-04-28  6:28 ` Grzegorz Uriasz [this message]
2020-04-28  8:10   ` [PATCH 1/2] Fix undefined behaviour Paul Durrant
2020-04-28  9:40     ` Artur Puzio
2020-04-28  9:40       ` Artur Puzio
2020-04-28 12:32       ` Paul Durrant
2020-04-28 12:33         ` Paul Durrant
2020-04-28  8:58   ` Peter Maydell
2020-04-28  6:28 ` [PATCH 2/2] Improve legacy vbios handling Grzegorz Uriasz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200428062847.7764-2-gorbak25@gmail.com \
    --to=gorbak25@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=artur@puzio.waw.pl \
    --cc=j.nowak26@student.uw.edu.pl \
    --cc=jakub@bartmin.ski \
    --cc=marmarek@invisiblethingslab.com \
    --cc=paul@xen.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.