diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index afa8eb3756..dd2788efd7 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -513,13 +513,13 @@ static int msi_msg_to_remap_entry( if ( rc ) return rc; + + if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI ) + nr = msi_desc->msi.nvec; } else set_hpet_source_id(msi_desc->hpet_id, &new_ire); - if ( msi_desc->msi_attrib.type == PCI_CAP_ID_MSI ) - nr = msi_desc->msi.nvec; - spin_lock_irqsave(&iommu->intremap.lock, flags); if ( msg == NULL )