aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/passthrough
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-02-18 09:37:35 +0100
committerJan Beulich <jbeulich@suse.com>2013-02-18 09:37:35 +0100
commitf547d42ec0306cdceffb8f7603c7e6f8977cf398 (patch)
treef647346db039168249810294724596950fe56960 /xen/drivers/passthrough
parent825ea023c1fe1c466a5c134cc65e4c95e0874b48 (diff)
downloadxen-f547d42ec0306cdceffb8f7603c7e6f8977cf398.tar.gz
xen-f547d42ec0306cdceffb8f7603c7e6f8977cf398.tar.bz2
xen-f547d42ec0306cdceffb8f7603c7e6f8977cf398.zip
AMD IOMMU: don't BUG() when we don't have to
find_iommu_for_device() can easily return NULL instead, as all of its callers are prepared for that. Signed-off-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/drivers/passthrough')
-rw-r--r--xen/drivers/passthrough/amd/pci_amd_iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index edf1b9f1f3..0f8cfeb56c 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -32,8 +32,8 @@ struct amd_iommu *find_iommu_for_device(int seg, int bdf)
{
struct ivrs_mappings *ivrs_mappings = get_ivrs_mappings(seg);
- BUG_ON ( bdf >= ivrs_bdf_entries );
- return ivrs_mappings ? ivrs_mappings[bdf].iommu : NULL;
+ return ivrs_mappings && bdf < ivrs_bdf_entries ? ivrs_mappings[bdf].iommu
+ : NULL;
}
/*