diff options
author | Xiu Jianfeng <xiujianfeng@huawei.com> | 2022-07-04 14:41:12 +0300 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-07-18 03:14:47 +0300 |
commit | 48725bbc0c3828bb9e36b632c6bf0326ed292ffb (patch) | |
tree | 0949f253bf4dc9390362beb4bc9cc1a204489c4b /mm/mprotect.c | |
parent | e75858b904b44510b7f4a0f8f1c08dfc0bf9009b (diff) | |
download | linux-48725bbc0c3828bb9e36b632c6bf0326ed292ffb.tar.xz |
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.c | 2 |
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); |