Skip to contentSkip to conversation

Dereference in fs/jbd/journal.c

PATCH New Eric Sesterhenn 1 participant 1 message Oct 5, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Dereference in fs/jbd/journal.c

hi,

since the commit http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1807793e1e7e502e3dc047115e9dbc3b50e4534
we dereference a NULL pointer. Coverity id #1432.
We set journal to NULL, and use it directly afterwards.

fs/jbd/journal.c renamed from fs/jbd/journal.c.orig +1 -1
@@ -724,7 +724,7 @@ journal_t * journal_init_dev(struct bloc
 		printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n",
 			__FUNCTION__);
 		kfree(journal);
-		journal = NULL;
+		return NULL;
 	}
 	journal->j_dev = bdev;
 	journal->j_fs_dev = fs_dev;