Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Xiu Jianfeng and committed by
akpm
48725bbc e75858b9

+1 -1
+1 -1
mm/mprotect.c
··· 663 663 { 664 664 unsigned long nstart, end, tmp, reqprot; 665 665 struct vm_area_struct *vma, *prev; 666 - int error = -EINVAL; 666 + int error; 667 667 const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP); 668 668 const bool rier = (current->personality & READ_IMPLIES_EXEC) && 669 669 (prot & PROT_READ);