]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mprotect: Fix do_mprotect_pkey() return on error mempolicy_fix
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 15:09:34 +0000 (11:09 -0400)
commitc895c88d05fef0960027611b15a5a94ac98647bb
treedbc6ca1a0533a99f27111be6f1026d53d8b96203
parent5a21388ce113248a608e0d1c2bb014fb7f70683d
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