Skip to content

Commit

Permalink
AMD IOMMU: free domain bitmap with its allocation order
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Sep 19, 2008
1 parent 6754086 commit d58befd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,8 @@ int __init amd_iommu_init(void)
return ret;

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,
get_order(rlookup_table_size));
Expand Down

0 comments on commit d58befd

Please sign in to comment.