]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mremap: avoid unneeded do_munmap call
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 29 Apr 2022 06:16:14 +0000 (23:16 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 06:16:14 +0000 (23:16 -0700)
commit3264871b82e1736d885d815856ce3cafb73471dd
treef6a07150f94cb5db7b0128f0825d10c508459c16
parentd91ca2a974882120309aff9a6b0a87d55584ebe1
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