summary refs log tree commit diff stats
path: root/hw/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hw/pci/pci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index f24c389627..81028cb083 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1912,7 +1912,12 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
     size = get_image_size(path);
     if (size < 0) {
         error_report("%s: failed to find romfile \"%s\"",
-                     __FUNCTION__, pdev->romfile);
+                     __func__, pdev->romfile);
+        g_free(path);
+        return -1;
+    } else if (size == 0) {
+        error_report("%s: ignoring empty romfile \"%s\"",
+                     __func__, pdev->romfile);
         g_free(path);
         return -1;
     }