diff options
author | Toshi Kani <toshi.kani@hpe.com> | 2016-02-17 22:11:29 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-19 01:23:24 +0100 |
commit | 9273a8bbf58a15051e53a777389a502420ddc60e (patch) | |
tree | dbca348bd6669d01ff60d896aba9de9f2b26f7c0 /kernel/memremap.c | |
parent | mm/hugetlb.c: fix incorrect proc nr_hugepages value (diff) | |
download | linux-9273a8bbf58a15051e53a777389a502420ddc60e.tar.xz linux-9273a8bbf58a15051e53a777389a502420ddc60e.zip |
devm_memremap_release(): fix memremap'd addr handling
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
so the kernel will leak a vma.
Fix devm_memremap_release() to handle a given memremap'd address
properly.
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Matthew Wilcox <willy@linux.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 '')
-rw-r--r-- | kernel/memremap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c index 2c468dea60bc..7a1b5c3ef14e 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) |