projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e75858b
)
mm/mprotect: remove the redundant initialization for error
author
Xiu Jianfeng
<xiujianfeng@huawei.com>
Mon, 4 Jul 2022 11:41:12 +0000
(19:41 +0800)
committer
akpm
<akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:47 +0000
(17:14 -0700)
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>
mm/mprotect.c
patch
|
blob
|
history
diff --git
a/mm/mprotect.c
b/mm/mprotect.c
index 5ef478b06a7d38d3ee5de8c6851ba8363a4a889a..8250c1315d9c7ba86c23d45568c0f6d3c15a9da3 100644
(file)
--- 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);