ioemu: Fix unmapping issue on hot-removing pass-thru device
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 20 Aug 2008 08:02:15 +0000 (09:02 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 20 Aug 2008 08:02:15 +0000 (09:02 +0100)
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
tools/ioemu/hw/pass-through.c

index ab1bc774b2cf98e29418696379b440454578a8f6..1c00b624b99e90bb90054f65cb690c4ae6963a13 100644 (file)
@@ -1423,7 +1423,7 @@ static void pt_unregister_regions(struct pt_dev *assigned_device)
     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
     {
         e_size = assigned_device->bases[i].e_size;
-        if ( e_size == 0 )
+        if ( (e_size == 0) || (assigned_device->bases[i].e_physbase == -1) )
             continue;
 
         type = d->io_regions[i].type;