diff options
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r-- | fs/gfs2/ops_inode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 247436c10deb..84350e1be66d 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -748,7 +748,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
748 | struct gfs2_rgrpd *nrgd; | 748 | struct gfs2_rgrpd *nrgd; |
749 | unsigned int num_gh; | 749 | unsigned int num_gh; |
750 | int dir_rename = 0; | 750 | int dir_rename = 0; |
751 | int alloc_required; | 751 | int alloc_required = 0; |
752 | unsigned int x; | 752 | unsigned int x; |
753 | int error; | 753 | int error; |
754 | 754 | ||
@@ -867,7 +867,9 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
867 | goto out_gunlock; | 867 | goto out_gunlock; |
868 | } | 868 | } |
869 | 869 | ||
870 | alloc_required = error = gfs2_diradd_alloc_required(ndir, &ndentry->d_name); | 870 | if (nip == NULL) |
871 | alloc_required = gfs2_diradd_alloc_required(ndir, &ndentry->d_name); | ||
872 | error = alloc_required; | ||
871 | if (error < 0) | 873 | if (error < 0) |
872 | goto out_gunlock; | 874 | goto out_gunlock; |
873 | error = 0; | 875 | error = 0; |
@@ -1086,7 +1088,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
1086 | error = vfs_follow_link(nd, buf); | 1088 | error = vfs_follow_link(nd, buf); |
1087 | if (buf != array) | 1089 | if (buf != array) |
1088 | kfree(buf); | 1090 | kfree(buf); |
1089 | } | 1091 | } else |
1092 | path_put(&nd->path); | ||
1090 | 1093 | ||
1091 | return ERR_PTR(error); | 1094 | return ERR_PTR(error); |
1092 | } | 1095 | } |