diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-10-20 15:23:13 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-10-25 02:41:14 +0200 |
commit | 41ee7232fa5f3c034f22baa52bc287e494e2129a (patch) | |
tree | 60bf6f64aeb45da6427a448e08347b02265453d5 /arch | |
parent | powerpc/smp: do not decrement idle task preempt count in CPU offline (diff) | |
download | linux-41ee7232fa5f3c034f22baa52bc287e494e2129a.tar.xz linux-41ee7232fa5f3c034f22baa52bc287e494e2129a.zip |
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: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211020132315.2287178-3-aik@ozlabs.ru
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index dab5c56ffd0e..c003f698eedd 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -1440,7 +1440,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) /* Keep default DMA window stuct if removed */ if (default_win_removed) { tbl->it_size = 0; - kfree(tbl->it_map); + vfree(tbl->it_map); + tbl->it_map = NULL; } set_iommu_table_base(&dev->dev, newtbl); |