Skip to content

Commit 41ee723

Browse files
aikmpe
authored andcommitted
powerpc/pseries/iommu: Use correct vfree for it_map
The it_map array is vzalloc'ed so use vfree() for it when creating a huge DMA window failed for whatever reason. While at this, write zero to it_map. Fixes: 381ceda ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Signed-off-by: Alexey Kardashevskiy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 787252a commit 41ee723

File tree

1 file changed

+2
-1
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+2
-1
lines changed

arch/powerpc/platforms/pseries/iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
14401440
/* Keep default DMA window stuct if removed */
14411441
if (default_win_removed) {
14421442
tbl->it_size = 0;
1443-
kfree(tbl->it_map);
1443+
vfree(tbl->it_map);
1444+
tbl->it_map = NULL;
14441445
}
14451446

14461447
set_iommu_table_base(&dev->dev, newtbl);

0 commit comments

Comments
 (0)