amd-iommu: fix an off-by-one error in the AMD IOMMU driver.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / x86 / kernel / amd_iommu_init.c
index 8c0be0902dacb2cc4e766cbe851891bd889f08e7..35fc9654c7a8bb81c9c3bd731f2f1960dda3d1e8 100644 (file)
@@ -175,7 +175,7 @@ static inline void update_last_devid(u16 devid)
 static inline unsigned long tbl_size(int entry_size)
 {
        unsigned shift = PAGE_SHIFT +
-                        get_order(amd_iommu_last_bdf * entry_size);
+                        get_order(((int)amd_iommu_last_bdf + 1) * entry_size);
 
        return 1UL << shift;
 }