]> err.no Git - linux-2.6/commitdiff
ext4: lost brelse in ext4_read_inode()
authorKirill Korotaev <dev@openvz.org>
Sun, 24 Jun 2007 00:16:51 +0000 (17:16 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 24 Jun 2007 15:59:12 +0000 (08:59 -0700)
One of error path in ext4_read_inode() leaks bh since brelse is forgoten.

Signed-off-by: Kirill Korotaev <dev@openvz.org>
Acked-by: Vasily Averin <vvs@sw.ru>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ext4/inode.c

index 0bcf62a750ffe29f788b5eb9d1c9b209ec8d3f54..8416fa28c422b2d8dc8369aebba51a5b8462afdc 100644 (file)
@@ -2673,8 +2673,10 @@ void ext4_read_inode(struct inode * inode)
                 */
                ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
                if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
-                   EXT4_INODE_SIZE(inode->i_sb))
+                   EXT4_INODE_SIZE(inode->i_sb)) {
+                       brelse (bh);
                        goto bad_inode;
+               }
                if (ei->i_extra_isize == 0) {
                        /* The extra space is currently unused. Use it. */
                        ei->i_extra_isize = sizeof(struct ext4_inode) -