diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-02-22 13:45:28 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-02-22 13:45:28 +0100 |
commit | 1eb4d2bee7109005e850bef502b317c7a41a7784 (patch) | |
tree | c41bcef3f55ef26702354d27ff9a41d648600105 | |
parent | 9b6884e385b61c9c603b4deafeda297ec7b63ca6 (diff) | |
download | xen-1eb4d2bee7109005e850bef502b317c7a41a7784.tar.gz xen-1eb4d2bee7109005e850bef502b317c7a41a7784.tar.bz2 xen-1eb4d2bee7109005e850bef502b317c7a41a7784.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>
master changeset: f547d42ec0306cdceffb8f7603c7e6f8977cf398
master date: 2013-02-18 09:37:35 +0100
-rw-r--r-- | xen/drivers/passthrough/amd/pci_amd_iommu.c | 4 |
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 78389fc047..2955cf0af6 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; } /* |