Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d3466a348a61c4d7f958ce80020eba17c09d7f7
Commit:     2d3466a348a61c4d7f958ce80020eba17c09d7f7
Parent:     82f703bb8cb2732b4437a9f555a1be564e9e71c2
Author:     Dmitriy Monakhov <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:24:37 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:14:59 2007 -0700

    reiserfs: possible null pointer dereference during resize
    
    sb_read may return NULL, let's explicitly check it.  If so free new bitmap
    blocks array, after this we may safely exit as it done above during bitmap
    allocation.
    
    Signed-off-by: Dmitriy Monakhov <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/reiserfs/resize.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c
index 3156847..976cc78 100644
--- a/fs/reiserfs/resize.c
+++ b/fs/reiserfs/resize.c
@@ -131,6 +131,10 @@ int reiserfs_resize(struct super_block *s, unsigned long 
block_count_new)
                        /* don't use read_bitmap_block since it will cache
                         * the uninitialized bitmap */
                        bh = sb_bread(s, i * s->s_blocksize * 8);
+                       if (!bh) {
+                               vfree(bitmap);
+                               return -EIO;
+                       }
                        memset(bh->b_data, 0, sb_blocksize(sb));
                        reiserfs_test_and_set_le_bit(0, bh->b_data);
                        reiserfs_cache_bitmap_metadata(s, bh, bitmap + i);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to