linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] devm_memremap_release: fix memremap'd addr handling
@ 2016-02-16 16:30 Toshi Kani
  2016-02-17  0:18 ` Andrew Morton
  2016-02-17  0:40 ` Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: Toshi Kani @ 2016-02-16 16:30 UTC (permalink / raw)
  To: dan.j.williams, akpm; +Cc: linux-nvdimm, linux-mm, linux-kernel, Toshi Kani

The pmem driver calls devm_memremap() to map a persistent memory
range.  When the pmem driver is unloaded, this memremap'd range
is not released.

Fix devm_memremap_release() to handle a given memremap'd address
properly.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 kernel/memremap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/memremap.c b/kernel/memremap.c
index 2c468de..7a1b5c3 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -114,7 +114,7 @@ EXPORT_SYMBOL(memunmap);
 
 static void devm_memremap_release(struct device *dev, void *res)
 {
-	memunmap(res);
+	memunmap(*(void **)res);
 }
 
 static int devm_memremap_match(struct device *dev, void *res, void *match_data)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-17  0:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 16:30 [PATCH] devm_memremap_release: fix memremap'd addr handling Toshi Kani
2016-02-17  0:18 ` Andrew Morton
2016-02-17  1:16   ` Toshi Kani
2016-02-17  0:40 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).