diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-29 22:04:36 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-29 22:04:36 -0500 |
commit | c44600c9d1de64314c2bd58103f15acb53e10073 (patch) | |
tree | 0b3541b04e60cb046f05a3725ce64c45c89adaa8 /fs/nfs/dir.c | |
parent | 696199f8ccf7fc6d17ef89c296ad3b6c78c52d9c (diff) |
nfs_lookup_revalidate(): fix a leak
We are leaking fattr and fhandle if we decide that dentry is not to
be invalidated, after all (e.g. happens to be a mountpoint). Just
free both before that...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 99489cfca24d..b9e66b7e0c14 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1101,6 +1101,8 @@ out_set_verifier: | |||
1101 | out_zap_parent: | 1101 | out_zap_parent: |
1102 | nfs_zap_caches(dir); | 1102 | nfs_zap_caches(dir); |
1103 | out_bad: | 1103 | out_bad: |
1104 | nfs_free_fattr(fattr); | ||
1105 | nfs_free_fhandle(fhandle); | ||
1104 | nfs_mark_for_revalidate(dir); | 1106 | nfs_mark_for_revalidate(dir); |
1105 | if (inode && S_ISDIR(inode->i_mode)) { | 1107 | if (inode && S_ISDIR(inode->i_mode)) { |
1106 | /* Purge readdir caches. */ | 1108 | /* Purge readdir caches. */ |
@@ -1113,8 +1115,6 @@ out_zap_parent: | |||
1113 | shrink_dcache_parent(dentry); | 1115 | shrink_dcache_parent(dentry); |
1114 | } | 1116 | } |
1115 | d_drop(dentry); | 1117 | d_drop(dentry); |
1116 | nfs_free_fattr(fattr); | ||
1117 | nfs_free_fhandle(fhandle); | ||
1118 | dput(parent); | 1118 | dput(parent); |
1119 | dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n", | 1119 | dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n", |
1120 | __func__, dentry->d_parent->d_name.name, | 1120 | __func__, dentry->d_parent->d_name.name, |