提交 48725bbc 编写于 作者: X Xiu Jianfeng 提交者: akpm

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.comSigned-off-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 e75858b9
...@@ -663,7 +663,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, ...@@ -663,7 +663,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
{ {
unsigned long nstart, end, tmp, reqprot; unsigned long nstart, end, tmp, reqprot;
struct vm_area_struct *vma, *prev; struct vm_area_struct *vma, *prev;
int error = -EINVAL; int error;
const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP); const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP);
const bool rier = (current->personality & READ_IMPLIES_EXEC) && const bool rier = (current->personality & READ_IMPLIES_EXEC) &&
(prot & PROT_READ); (prot & PROT_READ);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册