Skip to content

Commit

Permalink
AMD IOMMU: use cmd_buf_size when freeing the command buffer
Browse files Browse the repository at this point in the history
The command buffer release function uses the CMD_BUF_SIZE macro for
get_order. Replace this with iommu->cmd_buf_size which is more reliable
about the actual size of the buffer.

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 b514e55 commit 23c1713
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 @@ -433,7 +433,8 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu)

static void __init free_command_buffer(struct amd_iommu *iommu)
{
free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE));
free_pages((unsigned long)iommu->cmd_buf,
get_order(iommu->cmd_buf_size));
}

/* allocates the memory where the IOMMU will log its events to */
Expand Down

0 comments on commit 23c1713

Please sign in to comment.