Skip to content

Commit 434d2de

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Call memunmap in error path
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>
1 parent 06687a0 commit 434d2de

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/iommu/amd/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,7 @@ static bool copy_device_table(void)
980980
get_order(dev_table_size));
981981
if (old_dev_tbl_cpy == NULL) {
982982
pr_err("Failed to allocate memory for copying old device table!\n");
983+
memunmap(old_devtb);
983984
return false;
984985
}
985986

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

0 commit comments

Comments
 (0)