lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] mm/mprotect: Remove the redundant initialization for error
Date
The variable error will be assigned correctly before it is used, the
initialization is redundant, so remove it.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
mm/mprotect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 041beeb5fad6..0420c3ed936c 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);
--
2.17.1
\
 
 \ /
  Last update: 2022-07-04 13:44    [W:0.028 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site