aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-10-30 10:53:16 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-10-30 10:53:16 -0400
commit599a9b77ab289d85c2d5c8607624efbe1f552b0f (patch)
tree43e9dd2f0e5219a97918c9677b43c1c81abf4057 /fs
parent9378c6768e4fca48971e7b6a9075bc006eda981d (diff)
ext4: fix oops when loading block bitmap failed
When we fail to load block bitmap in __ext4_new_inode() we will dereference NULL pointer in ext4_journal_get_write_access(). So check for error from ext4_read_block_bitmap(). Coverity-id: 989065 Cc: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ialloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 8012a5daf401..ac644c31ca67 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -887,6 +887,10 @@ got:
887 struct buffer_head *block_bitmap_bh; 887 struct buffer_head *block_bitmap_bh;
888 888
889 block_bitmap_bh = ext4_read_block_bitmap(sb, group); 889 block_bitmap_bh = ext4_read_block_bitmap(sb, group);
890 if (!block_bitmap_bh) {
891 err = -EIO;
892 goto out;
893 }
890 BUFFER_TRACE(block_bitmap_bh, "get block bitmap access"); 894 BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
891 err = ext4_journal_get_write_access(handle, block_bitmap_bh); 895 err = ext4_journal_get_write_access(handle, block_bitmap_bh);
892 if (err) { 896 if (err) {