Commit 9a836de0 authored by Joerg Roedel's avatar Joerg Roedel Committed by Ingo Molnar

x86, AMD IOMMU: remove unnecessary free checks from init code

This patch removes unnecessary checks before memory is released.
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
Cc: iommu@lists.linux-foundation.org
Cc: bhavna.sarathy@amd.com
Cc: robert.richter@amd.com
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c571484e
...@@ -417,9 +417,7 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu) ...@@ -417,9 +417,7 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu)
static void __init free_command_buffer(struct amd_iommu *iommu) static void __init free_command_buffer(struct amd_iommu *iommu)
{ {
if (iommu->cmd_buf) free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE));
free_pages((unsigned long)iommu->cmd_buf,
get_order(CMD_BUFFER_SIZE));
} }
/* sets a specific bit in the device table entry. */ /* sets a specific bit in the device table entry. */
...@@ -987,22 +985,17 @@ out: ...@@ -987,22 +985,17 @@ out:
return ret; return ret;
free: free:
if (amd_iommu_pd_alloc_bitmap)
free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1); free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1);
if (amd_iommu_pd_table)
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));
if (amd_iommu_rlookup_table)
free_pages((unsigned long)amd_iommu_rlookup_table, free_pages((unsigned long)amd_iommu_rlookup_table,
get_order(rlookup_table_size)); get_order(rlookup_table_size));
if (amd_iommu_alias_table)
free_pages((unsigned long)amd_iommu_alias_table, free_pages((unsigned long)amd_iommu_alias_table,
get_order(alias_table_size)); get_order(alias_table_size));
if (amd_iommu_dev_table)
free_pages((unsigned long)amd_iommu_dev_table, free_pages((unsigned long)amd_iommu_dev_table,
get_order(dev_table_size)); get_order(dev_table_size));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment