Skip to content

Commit

Permalink
iommu/amd: Call memunmap in error path
Browse files Browse the repository at this point in the history
Unmap old_devtb in error path.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20220301085626.87680-3-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Vasant Hegde authored and Joerg Roedel committed Mar 8, 2022
1 parent 06687a0 commit 434d2de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/iommu/amd/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ static bool copy_device_table(void)
get_order(dev_table_size));
if (old_dev_tbl_cpy == NULL) {
pr_err("Failed to allocate memory for copying old device table!\n");
memunmap(old_devtb);
return false;
}

Expand Down Expand Up @@ -1010,6 +1011,7 @@ static bool copy_device_table(void)
if ((int_ctl != DTE_IRQ_REMAP_INTCTL) ||
(int_tab_len != DTE_INTTABLEN)) {
pr_err("Wrong old irq remapping flag: %#x\n", devid);
memunmap(old_devtb);
return false;
}

Expand Down

0 comments on commit 434d2de

Please sign in to comment.