[PATCH] null dereference in fs/jbd/journal.c
authorEric Sesterhenn <snakebyte@gmx.de>
Wed, 11 Oct 2006 08:20:37 +0000 (01:20 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 11 Oct 2006 18:14:14 +0000 (11:14 -0700)
Since commit d1807793e1e7e502e3dc047115e9dbc3b50e4534 we dereference a NULL
pointer.  Coverity id #1432.  We set journal to NULL, and use it directly
afterwards.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/jbd/journal.c

index c518dd8fe60a5c539055b33e7e6b33860daad361..b85c686b60dbc7f58c32e04740dcb7052056544e 100644 (file)
@@ -725,6 +725,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
                        __FUNCTION__);
                kfree(journal);
                journal = NULL;
+               goto out;
        }
        journal->j_dev = bdev;
        journal->j_fs_dev = fs_dev;
@@ -735,7 +736,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
        J_ASSERT(bh != NULL);
        journal->j_sb_buffer = bh;
        journal->j_superblock = (journal_superblock_t *)bh->b_data;
-
+out:
        return journal;
 }