]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mprotect: Fix do_mprotect_pkey() return on error maple_for6.5_unstable
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 5 Apr 2023 15:57:56 +0000 (11:57 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 6 Apr 2023 13:18:09 +0000 (09:18 -0400)
commitc996a0d5dba9cfcbcfd052aaed939339ccc32d2a
tree76543427e23b6a6e80afd4c7ed674651413dd5bc
parentc0ec186aaf91f08b99248f379afc9a1c8f70bb46
mm/mprotect: Fix do_mprotect_pkey() return on error

When the loop over the VMA is terminated early due to an error, the
return code could be overwritten with ENOMEM.  Fix this by only setting
the error code when it is not set already.

Fixes: 2286a6914c77 ("mm: change mprotect_fixup to vma iterator")
Cc: <stable@vger.kernel.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/mprotect.c