]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ext2: Zero our b_size in ext2_quota_read()
authorManish Katiyar <mkatiyar@gmail.com>
Thu, 12 Feb 2009 20:57:04 +0000 (21:57 +0100)
committerJan Kara <jack@suse.cz>
Thu, 26 Mar 2009 01:18:38 +0000 (02:18 +0100)
ext2_quota_read() doesn't initialize tmp_bh.b_size before calling
ext2_get_block() where we access it. Since it is a local variable it
might contain some garbage. Make sure it is filled with reasonable
value before passing.

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/super.c

index 7c6e3606f0ecd0d4c4efc64d262b0184b392deaa..f983225266dc7fa2066a5db6b0e929143f603ec1 100644 (file)
@@ -1331,6 +1331,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data,
                                sb->s_blocksize - offset : toread;
 
                tmp_bh.b_state = 0;
+               tmp_bh.b_size = sb->s_blocksize;
                err = ext2_get_block(inode, blk, &tmp_bh, 0);
                if (err < 0)
                        return err;