Skip to content

Commit

Permalink
ext4: fix potential null pointer dereference in ext4_free_inode
Browse files Browse the repository at this point in the history
Fix potential null pointer dereferencing problem caused by e43bb4e
("ext4: decrement free clusters/inodes counters when block group declared bad")

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Ashish Sangwan <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Reviewed-by: Lukas Czerner <[email protected]>
  • Loading branch information
namjaejeon authored and tytso committed Jul 12, 2014
1 parent 3f1f9b8 commit bf40c92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
fatal = err;
} else {
ext4_error(sb, "bit already cleared for inode %lu", ino);
if (!EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {
if (gdp && !EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {
int count;
count = ext4_free_inodes_count(sb, gdp);
percpu_counter_sub(&sbi->s_freeinodes_counter,
Expand Down

0 comments on commit bf40c92

Please sign in to comment.