mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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>
This commit is contained in:
1 parent
825ea023c1
commit
f547d42ec0
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||