]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mremap: avoid unneeded do_munmap call
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 14 Apr 2022 06:07:08 +0000 (23:07 -0700)
committerakpm <akpm@linux-foundation.org>
Thu, 14 Apr 2022 06:07:08 +0000 (23:07 -0700)
commitb9b1a9bcad264ccbfcbdba834074b09731fef566
tree0c8181c6ecc4facd5094de00954910f92cb57f98
parent68ee2705e7c2aee459b6caf4c3a1eecd58598ad7
mm/mremap: avoid unneeded do_munmap call

When old_len == new_len, do_munmap will return -EINVAL due to len == 0.
This errno will be simply ignored because of old_len != new_len check.  So
it is unnecessary to call do_munmap when old_len == new_len because
nothing is actually done.

Link: https://lkml.kernel.org/r/20220401081023.37080-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mremap.c