* [PATCH -next] mm/mprotect: Remove the redundant initialization for error
@ 2022-07-04 11:41 Xiu Jianfeng
0 siblings, 0 replies; only message in thread
From: Xiu Jianfeng @ 2022-07-04 11:41 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-04 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 11:41 [PATCH -next] mm/mprotect: Remove the redundant initialization for error Xiu Jianfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).