[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1011011551001.2876@dhcp-lab-213.englab.brq.redhat.com>
Date: Mon, 1 Nov 2010 16:27:26 +0100 (CET)
From: Lukas Czerner <lczerner@...hat.com>
To: Stefan Richter <stefanr@...6.in-berlin.de>
cc: Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org, Theodore Tso <tytso@....edu>
Subject: Re: ext4_lazyinit_thread: 'ret' may be used uninitialized in this
function
On Sun, 31 Oct 2010, Stefan Richter wrote:
> Commit bfff68738f1c "ext4: add support for lazy inode table
> initialization" added the following build warning:
>
> fs/ext4/super.c: In function 'ext4_lazyinit_thread':
> fs/ext4/super.c:2702: warning: 'ret' may be used uninitialized in this function
>
> This warning is due to an actual bug. But I don't know what the fix is.
>
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@...hat.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@...hat.com>
Reported-by: "Stefan Richter" <stefanr@...6.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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists