From b8032734ee94f4031c71aa40f100e9ef181ea0ef Mon Sep 17 00:00:00 2001 From: Kim Phillips <kim.phillips@freescale.com> Date: Tue, 3 Jul 2012 17:41:56 -0500 Subject: [PATCH] ext2fs: fix warning: 'blocknxt' may be used uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This warning was introduced in 436da3c "ext2load: increase read speed": ext2fs.c: In function 'ext2fs_read_file': ext2fs.c:458:19: warning: 'blocknxt' may be used uninitialized in this function [-Wuninitialized] this change makes it go away. Cc: Eric Nelson <eric.nelson@boundarydevices.com> Cc: Thierry Reding <thierry.reding@avionic-design.de> Cc: Jason Cooper <u-boot@lakedaemon.net> Cc: Andreas BieÃmann <andreas.devel@googlemail.com> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> --- fs/ext2/ext2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index f1fce48a39..182f0acaca 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -438,7 +438,7 @@ int ext2fs_read_file } /* grab middle blocks in one go */ - if (i != pos / blocksize && i != blockcnt - 1 && blockcnt > 3) { + if (i != pos / blocksize && i < blockcnt - 1 && blockcnt > 3) { int oldblk = blknr; int blocknxt; while (i < blockcnt - 1) { -- 2.39.5