Skip to contentSkip to conversation

pc: don't access fw cfg if NULL

PATCH In review Michael S. Tsirkin 2 participants 2 messages Jul 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc: don't access fw cfg if NULL

commit f8c457b88d72a48989f190bc3d7b79f4f3b7d11c
"pc: pass PCI hole ranges to Guests"
broke Xen as it has no fw_cfg.
Check for this configuration and boil out.

---

Anthony, could you fast-track this into master please? Thanks!

 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +1 -1
index 9f9207d..c7fc475 100644
@@ -999,7 +999,7 @@ typedef struct PcRomPciInfo {
 static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info)
 {
     PcRomPciInfo *info;
-    if (!guest_info->has_pci_info) {
+    if (!guest_info->has_pci_info || !guest_info->fw_cfg) {
         return;
     }
 
Signature · 1 line
MST
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · On Thu, 11 Jul 2013 14:52:40 +0300 "Michael S. Tsirkin" <[email protected]> wrote:

commit f8c457b88d72a48989f190bc3d7b79f4f3b7d11c
"pc: pass PCI hole ranges to Guests"
broke Xen as it has no fw_cfg.
Check for this configuration and boil out.

---

Anthony, could you fast-track this into master please? Thanks!

 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/pc.c +0 -0
index 9f9207d..c7fc475 100644

hw/i386/pc.c typedef struct PcRomPciInfo { · line 1005

Quoted 8 lines
hw/i386/pc.c +1 -1
@@ -999,7 +999,7 @@ typedef struct PcRomPciInfo {
 static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info)
 {
     PcRomPciInfo *info;
-    if (!guest_info->has_pci_info) {
+    if (!guest_info->has_pci_info || !guest_info->fw_cfg) {
         return;
     }