瀏覽代碼

AMD IOMMU: free domain bitmap with its allocation order

The amd_iommu_pd_alloc_bitmap is allocated with a calculated order and
freed with order 1. This is not a bug since the calculated order always
evaluates to 1, but its unclean code. So replace the 1 with the
calculation in the release path.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Joerg Roedel 16 年之前
父節點
當前提交
d58befd3a0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      arch/x86/kernel/amd_iommu_init.c

+ 2 - 1
arch/x86/kernel/amd_iommu_init.c

@@ -1144,7 +1144,8 @@ out:
 	return ret;
 	return ret;
 
 
 free:
 free:
-	free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1);
+	free_pages((unsigned long)amd_iommu_pd_alloc_bitmap,
+		   get_order(MAX_DOMAIN_ID/8));
 
 
 	free_pages((unsigned long)amd_iommu_pd_table,
 	free_pages((unsigned long)amd_iommu_pd_table,
 		   get_order(rlookup_table_size));
 		   get_order(rlookup_table_size));