Skip to content

Commit 8c68fac

Browse files
committed
Merge branch 'for_linus_urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 bugfix from Ted Ts'o. [ Hmm. It's possible we should make kfree() aware of error pointers, and use IS_ERR_OR_NULL rather than a NULL check. But in the meantime this is obviously the right fix. - Linus ] * 'for_linus_urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: avoid trying to kfree an ERR_PTR pointer
2 parents 861b710 + a9cfcd6 commit 8c68fac

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

fs/ext4/namei.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,6 +3240,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
32403240
&new.de, &new.inlined);
32413241
if (IS_ERR(new.bh)) {
32423242
retval = PTR_ERR(new.bh);
3243+
new.bh = NULL;
32433244
goto end_rename;
32443245
}
32453246
if (new.bh) {
@@ -3386,6 +3387,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
33863387
&new.de, &new.inlined);
33873388
if (IS_ERR(new.bh)) {
33883389
retval = PTR_ERR(new.bh);
3390+
new.bh = NULL;
33893391
goto end_rename;
33903392
}
33913393

fs/ext4/resize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
575575
bh = bclean(handle, sb, block);
576576
if (IS_ERR(bh)) {
577577
err = PTR_ERR(bh);
578+
bh = NULL;
578579
goto out;
579580
}
580581
overhead = ext4_group_overhead_blocks(sb, group);
@@ -603,6 +604,7 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
603604
bh = bclean(handle, sb, block);
604605
if (IS_ERR(bh)) {
605606
err = PTR_ERR(bh);
607+
bh = NULL;
606608
goto out;
607609
}
608610

0 commit comments

Comments
 (0)