diff options
author | Xiu Jianfeng <xiujianfeng@huawei.com> | 2022-07-04 13:41:12 +0200 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-07-18 02:14:47 +0200 |
commit | 48725bbc0c3828bb9e36b632c6bf0326ed292ffb (patch) | |
tree | 0949f253bf4dc9390362beb4bc9cc1a204489c4b /mm | |
parent | mm/huge_memory: use helper macro IS_ERR_OR_NULL in split_huge_pages_pid (diff) | |
download | linux-48725bbc0c3828bb9e36b632c6bf0326ed292ffb.tar.xz linux-48725bbc0c3828bb9e36b632c6bf0326ed292ffb.zip |
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')
-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); |