linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] exec: Remove unnecessary ‘NULL’ values from vma
@ 2024-02-20  5:18 Li zeming
  2024-02-24  1:04 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2024-02-20  5:18 UTC (permalink / raw)
  To: viro, brauner, ebiederm, keescook
  Cc: linux-fsdevel, linux-mm, linux-kernel, Li zeming

vma is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/exec.c b/fs/exec.c
index af4fbb61cd53e..7be0527f5ff25 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -254,7 +254,7 @@ static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos,
 static int __bprm_mm_init(struct linux_binprm *bprm)
 {
 	int err;
-	struct vm_area_struct *vma = NULL;
+	struct vm_area_struct *vma;
 	struct mm_struct *mm = bprm->mm;
 
 	bprm->vma = vma = vm_area_alloc(mm);
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] exec: Remove unnecessary ‘NULL’ values from vma
  2024-02-20  5:18 [PATCH] exec: Remove unnecessary ‘NULL’ values from vma Li zeming
@ 2024-02-24  1:04 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2024-02-24  1:04 UTC (permalink / raw)
  To: Li zeming; +Cc: viro, brauner, ebiederm, linux-fsdevel, linux-mm, linux-kernel

On Tue, Feb 20, 2024 at 01:18:30PM +0800, Li zeming wrote:
> vma is assigned first, so it does not need to initialize the
> assignment.

I don't really like removing explicit initializations. They don't cause
any problems and the compiler will remove redundant stores, so there's
no benefit in dropping them.

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-24  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20  5:18 [PATCH] exec: Remove unnecessary ‘NULL’ values from vma Li zeming
2024-02-24  1:04 ` Kees Cook

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).