summaryrefslogtreecommitdiff
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorXiu Jianfeng <xiujianfeng@huawei.com>2022-07-04 19:41:12 +0800
committerakpm <akpm@linux-foundation.org>2022-07-17 17:14:47 -0700
commit48725bbc0c3828bb9e36b632c6bf0326ed292ffb (patch)
tree0949f253bf4dc9390362beb4bc9cc1a204489c4b /mm/mprotect.c
parente75858b904b44510b7f4a0f8f1c08dfc0bf9009b (diff)
mm/mprotect: remove the redundant initialization for error
The variable error will be assigned correctly before it is used, the initialization is redundant, so remove it. Link: https://lkml.kernel.org/r/20220704114112.163112-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 5ef478b06a7d..8250c1315d9c 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -663,7 +663,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
{
unsigned long nstart, end, tmp, reqprot;
struct vm_area_struct *vma, *prev;
- int error = -EINVAL;
+ int error;
const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP);
const bool rier = (current->personality & READ_IMPLIES_EXEC) &&
(prot & PROT_READ);