From: Jan Beulich Date: Mon, 7 Nov 2016 13:08:05 +0000 (+0100) Subject: IOMMU: replace ASSERT()s checking for NULL X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~114 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7b2842a414;p=xen.git IOMMU: replace ASSERT()s checking for NULL Avoid NULL derefs on non-debug builds. Coverity ID: 1055650 Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Release-acked-by: Wei Liu --- diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 66577b6c44..574d22a0cd 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -165,7 +165,11 @@ static void pt_irq_time_out(void *data) spin_lock(&irq_map->dom->event_lock); dpci = domain_get_irq_dpci(irq_map->dom); - ASSERT(dpci); + if ( unlikely(!dpci) ) + { + ASSERT_UNREACHABLE(); + return; + } list_for_each_entry ( digl, &irq_map->digl_list, list ) { unsigned int guest_gsi = hvm_pci_intx_gsi(digl->device, digl->intx); @@ -793,7 +797,11 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector) static void hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci) { - ASSERT(d->arch.hvm_domain.irq.dpci); + if ( unlikely(!d->arch.hvm_domain.irq.dpci) ) + { + ASSERT_UNREACHABLE(); + return; + } spin_lock(&d->event_lock); if ( test_and_clear_bool(pirq_dpci->masked) )