diff options
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 1f148393cf7a..0f5a9115a694 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -417,9 +417,7 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu) | |||
417 | 417 | ||
418 | static void __init free_command_buffer(struct amd_iommu *iommu) | 418 | static void __init free_command_buffer(struct amd_iommu *iommu) |
419 | { | 419 | { |
420 | if (iommu->cmd_buf) | 420 | free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE)); |
421 | free_pages((unsigned long)iommu->cmd_buf, | ||
422 | get_order(CMD_BUFFER_SIZE)); | ||
423 | } | 421 | } |
424 | 422 | ||
425 | /* sets a specific bit in the device table entry. */ | 423 | /* sets a specific bit in the device table entry. */ |
@@ -987,24 +985,19 @@ out: | |||
987 | return ret; | 985 | return ret; |
988 | 986 | ||
989 | free: | 987 | free: |
990 | if (amd_iommu_pd_alloc_bitmap) | 988 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1); |
991 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1); | ||
992 | 989 | ||
993 | if (amd_iommu_pd_table) | 990 | free_pages((unsigned long)amd_iommu_pd_table, |
994 | free_pages((unsigned long)amd_iommu_pd_table, | 991 | get_order(rlookup_table_size)); |
995 | get_order(rlookup_table_size)); | ||
996 | 992 | ||
997 | if (amd_iommu_rlookup_table) | 993 | free_pages((unsigned long)amd_iommu_rlookup_table, |
998 | free_pages((unsigned long)amd_iommu_rlookup_table, | 994 | get_order(rlookup_table_size)); |
999 | get_order(rlookup_table_size)); | ||
1000 | 995 | ||
1001 | if (amd_iommu_alias_table) | 996 | free_pages((unsigned long)amd_iommu_alias_table, |
1002 | free_pages((unsigned long)amd_iommu_alias_table, | 997 | get_order(alias_table_size)); |
1003 | get_order(alias_table_size)); | ||
1004 | 998 | ||
1005 | if (amd_iommu_dev_table) | 999 | free_pages((unsigned long)amd_iommu_dev_table, |
1006 | free_pages((unsigned long)amd_iommu_dev_table, | 1000 | get_order(dev_table_size)); |
1007 | get_order(dev_table_size)); | ||
1008 | 1001 | ||
1009 | free_iommu_all(); | 1002 | free_iommu_all(); |
1010 | 1003 | ||