Re: ext4_lazyinit_thread: 'ret' may be used uninitialized in this function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lukas Czerner
Date: Monday, November 1, 2010 - 8:27 am

On Sun, 31 Oct 2010, Stefan Richter wrote:


Hi Stefan,

thank you for noticing this, because I actually do not see the warning
(I wonder why...), but it is definitely a bug, so the trivial patch below
should fix that.

Thanks!
-Lukas

From 3594c17e3f724356ea8cc0a1579ab09990a771ac Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Mon, 1 Nov 2010 15:44:54 +0100
Subject: [PATCH] ext4: fix using uninitialized variable

The ret variable might be used uninitialized. Fix this by  initializing
it in definition.

Signed-off-by: "Lukas Czerner" <lczerner@redhat.com>
Reported-by: "Stefan Richter" <stefanr@s5r6.in-berlin.de>
---
 fs/ext4/super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8d1d942..aff17cf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2699,7 +2699,7 @@ static int ext4_lazyinit_thread(void *arg)
 	struct ext4_li_request *elr;
 	unsigned long next_wakeup;
 	DEFINE_WAIT(wait);
-	int ret;
+	int ret = 0;
 
 	BUG_ON(NULL == eli);
 
-- 
1.7.2.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: ext4_lazyinit_thread: 'ret' may be used uninitialized ..., Lukas Czerner, (Mon Nov 1, 8:27 am)
Re: ext4_lazyinit_thread: 'ret' may be used uninitialized ..., Brian Gitonga Marete, (Tue Nov 2, 1:08 pm)