Commit 8c68face5548cdecb770d75ad44a74aec9352d10

Authored by Linus Torvalds

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

Showing 2 changed files Side-by-side Diff

... ... @@ -3240,6 +3240,7 @@
3240 3240 &new.de, &new.inlined);
3241 3241 if (IS_ERR(new.bh)) {
3242 3242 retval = PTR_ERR(new.bh);
  3243 + new.bh = NULL;
3243 3244 goto end_rename;
3244 3245 }
3245 3246 if (new.bh) {
... ... @@ -3386,6 +3387,7 @@
3386 3387 &new.de, &new.inlined);
3387 3388 if (IS_ERR(new.bh)) {
3388 3389 retval = PTR_ERR(new.bh);
  3390 + new.bh = NULL;
3389 3391 goto end_rename;
3390 3392 }
3391 3393  
... ... @@ -575,6 +575,7 @@
575 575 bh = bclean(handle, sb, block);
576 576 if (IS_ERR(bh)) {
577 577 err = PTR_ERR(bh);
  578 + bh = NULL;
578 579 goto out;
579 580 }
580 581 overhead = ext4_group_overhead_blocks(sb, group);
... ... @@ -603,6 +604,7 @@
603 604 bh = bclean(handle, sb, block);
604 605 if (IS_ERR(bh)) {
605 606 err = PTR_ERR(bh);
  607 + bh = NULL;
606 608 goto out;
607 609 }
608 610