Skip to content

Commit

Permalink
devm_memremap_release(): fix memremap'd addr handling
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Dan Williams <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
toshikani authored and torvalds committed Feb 19, 2016
1 parent f8b7481 commit 9273a8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/memremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9273a8b

Please sign in to comment.