[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/4] AMD IOMMU: don't BUG() when we don't have to
On 02/15/2013 11:19 AM, Jan Beulich wrote: find_iommu_for_device() can easily return NULL instead, as all of its callers are prepared for that. This patch is obsoleted by the second patch ("[PATCH 2/4] AMD IOMMU: cover all functions of a device even if ACPI only tells us of func 0"), isn't it? -boris Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- 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( { 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; }/* _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |