xen/flask: fix crash on debugkey "i"
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Wed, 13 Feb 2013 17:04:33 +0000 (17:04 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Wed, 13 Feb 2013 17:04:33 +0000 (17:04 +0000)
The IRQs beyond nr_static_irqs do not all have an associated PCI
device, so only query the device SID if pci is not NULL.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/xsm/flask/hooks.c

index 85d009c42b03ec32b5ffed1913b683642d76cf37..29a78dd06e5ed2b6b46ed4841bd2d7a029a3198e 100644 (file)
@@ -110,7 +110,7 @@ static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
         }
         return security_irq_sid(irq, sid);
     }
-    if ( desc->msi_desc ) {
+    if ( desc->msi_desc && desc->msi_desc->dev ) {
         struct pci_dev *dev = desc->msi_desc->dev;
         u32 sbdf = (dev->seg << 16) | (dev->bus << 8) | dev->devfn;
         if (ad) {