ext3: NULL dereference in ext3_evict_inode()
[pandora-kernel.git] / fs / ext3 / inode.c
index d12f961..ff33188 100644 (file)
@@ -223,8 +223,12 @@ void ext3_evict_inode (struct inode *inode)
         *
         * Note that directories do not have this problem because they don't
         * use page cache.
+        *
+        * The s_journal check handles the case when ext3_get_journal() fails
+        * and puts the journal inode.
         */
        if (inode->i_nlink && ext3_should_journal_data(inode) &&
+           EXT3_SB(inode->i_sb)->s_journal &&
            (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode))) {
                tid_t commit_tid = atomic_read(&ei->i_datasync_tid);
                journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;