]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ext4: fix use of potentially uninitialized variables in debugging code
authorAndi Shyti <andi@etezian.org>
Wed, 28 Aug 2013 18:00:00 +0000 (14:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 Aug 2013 18:00:00 +0000 (14:00 -0400)
If ext_debugging is enabled and path[depth].p_ext is NULL, len
and lblock are printed non initialized

Signed-off-by: Andi Shyti <andi@etezian.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c

index 62b21ccea882f349e0d0746795733fae714b3cd2..e7580aeb6fbc77dbd9f8cb54e6f4fdcc15683b4b 100644 (file)
@@ -2285,8 +2285,8 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
                                ext4_lblk_t block)
 {
        int depth = ext_depth(inode);
-       unsigned long len;
-       ext4_lblk_t lblock;
+       unsigned long len = 0;
+       ext4_lblk_t lblock = 0;
        struct ext4_extent *ex;
 
        ex = path[depth].p_ext;
@@ -2323,7 +2323,6 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
                        ext4_es_insert_extent(inode, lblock, len, ~0,
                                              EXTENT_STATUS_HOLE);
        } else {
-               lblock = len = 0;
                BUG();
        }