[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen-unstable] passthrough: Fix no_wb not to crash on unknown registers



commit 9297e6402f6aa1b52e5577edc875eb2d2163baeb
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Mon Dec 7 12:25:54 2009 +0000

    passthrough: Fix no_wb not to crash on unknown registers
    
    e2b98415256cb264bc25e6df539ec0dc9d1b85b0 broke things sometimes:
    
     If pt_find_reg_grp() fails and returns NULL, it will jump to out:,
     but at this time reg is still NULL (pt_find_reg() is not reached)
     which leads to a NULL dereference.
    
    This patch fixes it.
    
    Submitted-By: Qing He <qing.he@xxxxxxxxx>
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 hw/pass-through.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index b125d72..e7bd386 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -1556,7 +1556,7 @@ static void pt_pci_write_config(PCIDevice *d, uint32_t 
address, uint32_t val,
     val >>= ((address & 3) << 3);
 
 out:
-    if (!reg->no_wb) {
+    if (!(reg && reg->no_wb)) {  /* unknown regs are passed through */
         ret = pci_write_block(pci_dev, address, (uint8_t *)&val, len);
 
         if (!ret)
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.