From: Eric Sesterhenn Date: Wed, 11 Oct 2006 08:20:37 +0000 (-0700) Subject: [PATCH] null dereference in fs/jbd/journal.c X-Git-Tag: v2.6.19-rc2~139 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=41716c7c21b15e7ecf14f0caf1eef3980707fb74;p=~emulex%2Finfiniband.git [PATCH] null dereference in fs/jbd/journal.c 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index c518dd8fe60..b85c686b60d 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c @@ -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; }