Skip to content

Commit

Permalink
Merge tag 'affs-for-5.12-tag' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/kdave/linux

Pull AFFS fix from David Sterba:
 "One minor fix for error handling in rename exchange"

* tag 'affs-for-5.12-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  fs/affs: release old buffer head on error path
  • Loading branch information
torvalds committed Feb 21, 2021
2 parents d88e8b6 + 70779b8 commit f9d58de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/affs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,10 @@ affs_xrename(struct inode *old_dir, struct dentry *old_dentry,
return -EIO;

bh_new = affs_bread(sb, d_inode(new_dentry)->i_ino);
if (!bh_new)
if (!bh_new) {
affs_brelse(bh_old);
return -EIO;
}

/* Remove old header from its parent directory. */
affs_lock_dir(old_dir);
Expand Down

0 comments on commit f9d58de

Please sign in to comment.