projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
825ea02
)
AMD IOMMU: don't BUG() when we don't have to
author
Jan Beulich
<jbeulich@suse.com>
Mon, 18 Feb 2013 08:37:35 +0000
(09:37 +0100)
committer
Jan Beulich
<jbeulich@suse.com>
Mon, 18 Feb 2013 08:37:35 +0000
(09:37 +0100)
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>
xen/drivers/passthrough/amd/pci_amd_iommu.c
patch
|
blob
|
history
diff --git
a/xen/drivers/passthrough/amd/pci_amd_iommu.c
b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index edf1b9f1f30e9dd33ed7b0fd2d8bab83f23be8b8..0f8cfeb56c533d4e51114c2b092a9888b1885195 100644
(file)
--- 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;
}
/*