summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-10-30 10:53:16 -0400
committerBen Hutchings <ben@decadent.org.uk>2014-12-14 16:23:53 +0000
commit93604e7651f6cfccaa34d4fdb18b6a337594912e (patch)
tree6418ffca96be8218c18512fe6b563f28b6ce67d4 /fs
parent2bd34f24f5db5997268f779c42a8dca20514a6f7 (diff)
downloadlinux-stable-93604e7651f6cfccaa34d4fdb18b6a337594912e.tar.gz
linux-stable-93604e7651f6cfccaa34d4fdb18b6a337594912e.tar.bz2
linux-stable-93604e7651f6cfccaa34d4fdb18b6a337594912e.zip
ext4: fix oops when loading block bitmap failed
commit 599a9b77ab289d85c2d5c8607624efbe1f552b0f upstream. 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 Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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 6d1f5779235d..a308844adbdb 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -813,6 +813,10 @@ got:
struct buffer_head *block_bitmap_bh;
block_bitmap_bh = ext4_read_block_bitmap(sb, group);
+ if (!block_bitmap_bh) {
+ err = -EIO;
+ goto out;
+ }
BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
err = ext4_journal_get_write_access(handle, block_bitmap_bh);
if (err) {