2018-11-21 10:07:56

by Pan Bian

[permalink] [raw]
Subject: [PATCH] iommu: use memunmap to free memremap

memunmap() should be used to free the return of memremap(), not
iounmap().

Fixes: dfddb969edf0("iommu/vt-d: Switch from ioremap_cache to memremap")
Signed-off-by: Pan Bian <[email protected]>
---
drivers/iommu/intel-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index f3ccf02..41a4b88 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3075,7 +3075,7 @@ static int copy_context_table(struct intel_iommu *iommu,
}

if (old_ce)
- iounmap(old_ce);
+ memunmap(old_ce);

ret = 0;
if (devfn < 0x80)
--
2.7.4




2018-11-24 03:12:42

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH] iommu: use memunmap to free memremap

On Wed, Nov 21, 2018 at 05:53:47PM +0800, Pan Bian wrote:
> memunmap() should be used to free the return of memremap(), not
> iounmap().
>
> Fixes: dfddb969edf0("iommu/vt-d: Switch from ioremap_cache to memremap")
> Signed-off-by: Pan Bian <[email protected]>
> ---
> drivers/iommu/intel-iommu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.