ioemu: Add check for mapping MSI pirqs.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 2 Jul 2008 08:45:18 +0000 (09:45 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 2 Jul 2008 08:45:18 +0000 (09:45 +0100)
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/ioemu/hw/pt-msi.c

index 0af05e788f5b45fad533846f5ae7296a44251eaa..5e7c4795515f5689c2c4e6833a7ebb58358f6971 100644 (file)
@@ -94,6 +94,13 @@ static int pt_msi_setup(struct pt_dev *dev)
         PT_LOG("error map msi\n");
         return -1;
     }
+
+    if ( pirq < 0 )
+    {
+        PT_LOG("invalid pirq number\n");
+        return -1;
+    }
+
     dev->msi->pirq = pirq;
     PT_LOG("msi mapped with pirq %x\n", pirq);