Commit 434d2def authored by Vasant Hegde's avatar Vasant Hegde Committed by Joerg Roedel

iommu/amd: Call memunmap in error path

Unmap old_devtb in error path.
Signed-off-by: default avatarVasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20220301085626.87680-3-vasant.hegde@amd.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 06687a03
...@@ -980,6 +980,7 @@ static bool copy_device_table(void) ...@@ -980,6 +980,7 @@ static bool copy_device_table(void)
get_order(dev_table_size)); get_order(dev_table_size));
if (old_dev_tbl_cpy == NULL) { if (old_dev_tbl_cpy == NULL) {
pr_err("Failed to allocate memory for copying old device table!\n"); pr_err("Failed to allocate memory for copying old device table!\n");
memunmap(old_devtb);
return false; return false;
} }
...@@ -1010,6 +1011,7 @@ static bool copy_device_table(void) ...@@ -1010,6 +1011,7 @@ static bool copy_device_table(void)
if ((int_ctl != DTE_IRQ_REMAP_INTCTL) || if ((int_ctl != DTE_IRQ_REMAP_INTCTL) ||
(int_tab_len != DTE_INTTABLEN)) { (int_tab_len != DTE_INTTABLEN)) {
pr_err("Wrong old irq remapping flag: %#x\n", devid); pr_err("Wrong old irq remapping flag: %#x\n", devid);
memunmap(old_devtb);
return false; return false;
} }
......
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