aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs/namei.c')
-rw-r--r--fs/affs/namei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index 1ed0fa4c4d48..5863e2157ef5 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -461,8 +461,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);