]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Fix devm_memremap_pages() collision handling
authorJan H. Schönherr <jschoenh@amazon.de>
Sat, 20 Jan 2018 00:26:33 +0000 (16:26 -0800)
committerDan Williams <dan.j.williams@intel.com>
Sat, 20 Jan 2018 00:29:56 +0000 (16:29 -0800)
commit39966e11d227b2146ae81c542e110507c5342082
tree3787433794cb87a82998f80b7505da548a0c4649
parent6a123e12ee18c7174c5bff000a99c12cca141745
mm: Fix devm_memremap_pages() collision handling

If devm_memremap_pages() detects a collision while adding entries
to the radix-tree, we call pgmap_radix_release(). Unfortunately,
the function removes *all* entries for the range -- including the
entries that caused the collision in the first place.

Modify pgmap_radix_release() to take an additional argument to
indicate where to stop, so that only newly added entries are removed
from the tree.

Cc: <stable@vger.kernel.org>
Fixes: 2a1b6872e318 ("mm: introduce find_dev_pagemap()")
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
kernel/memremap.c