summaryrefslogtreecommitdiffstats
path: root/kernel/iomem.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>2019-07-11 20:52:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-12 11:05:40 -0700
commit9bd3bb6703d8c0a5fb8aec8e3287bd55b7341dcd (patch)
treeb27a6fceb354a924fa5b113dacd7b0913bbfd239 /kernel/iomem.c
parent2c012a4ad1a2cd3fb5a0f9307b9d219f84eda1fa (diff)
downloadlinux-9bd3bb6703d8c0a5fb8aec8e3287bd55b7341dcd.tar.bz2
mm/nvdimm: add is_ioremap_addr and use that to check ioremap address
Architectures like powerpc use different address range to map ioremap and vmalloc range. The memunmap() check used by the nvdimm layer was wrongly using is_vmalloc_addr() to check for ioremap range which fails for ppc64. This result in ppc64 not freeing the ioremap mapping. The side effect of this is an unbind failure during module unload with papr_scm nvdimm driver Link: http://lkml.kernel.org/r/20190701134038.14165-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Fixes: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions") Cc: Dan Williams <dan.j.williams@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/iomem.c')
-rw-r--r--kernel/iomem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/iomem.c b/kernel/iomem.c
index 93c264444510..62c92e43aa0d 100644
--- a/kernel/iomem.c
+++ b/kernel/iomem.c
@@ -121,7 +121,7 @@ EXPORT_SYMBOL(memremap);
void memunmap(void *addr)
{
- if (is_vmalloc_addr(addr))
+ if (is_ioremap_addr(addr))
iounmap((void __iomem *) addr);
}
EXPORT_SYMBOL(memunmap);