Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757717Ab0KAP1n (ORCPT ); Mon, 1 Nov 2010 11:27:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416Ab0KAP1k (ORCPT ); Mon, 1 Nov 2010 11:27:40 -0400 Date: Mon, 1 Nov 2010 16:27:26 +0100 (CET) From: Lukas Czerner X-X-Sender: lukas@dhcp-lab-213.englab.brq.redhat.com To: Stefan Richter cc: Lukas Czerner , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Theodore Tso Subject: Re: ext4_lazyinit_thread: 'ret' may be used uninitialized in this function In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 55 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 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" Reported-by: "Stefan Richter" --- 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/