[U-Boot] [PATCH] ext2fs: fix warning: 'blocknxt' may be used uninitialized
Kim Phillips
kim.phillips at freescale.com
Tue Jul 3 18:05:42 CEST 2012
ext2fs.c: In function 'ext2fs_read_file':
ext2fs.c:458:19: warning: 'blocknxt' may be used uninitialized in this function [-Wuninitialized]
Cc: Jason Cooper <u-boot at lakedaemon.net>
Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
---
is this right?
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 f1fce48..c6c950e 100644
--- a/fs/ext2/ext2fs.c
+++ b/fs/ext2/ext2fs.c
@@ -440,7 +440,7 @@ int ext2fs_read_file
/* grab middle blocks in one go */
if (i != pos / blocksize && i != blockcnt - 1 && blockcnt > 3) {
int oldblk = blknr;
- int blocknxt;
+ int blocknxt = 0;
while (i < blockcnt - 1) {
blocknxt = ext2fs_read_block(node, i + 1);
if (blocknxt == (oldblk + 1)) {
--
1.7.11.1
More information about the U-Boot
mailing list