diff options
author | Krishna Kumar <krkumar2@in.ibm.com> | 2008-10-20 02:14:40 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-22 14:04:34 -0400 |
commit | 6dfcde98a299196f13dd66417663a819f0ac4156 (patch) | |
tree | 78c2d21004ec9216784d264bdcc7b8b2692660f8 /fs/nfsd/export.c | |
parent | 6c6a426fdcb374b7641d7cf9eea88410828b9d9a (diff) |
nfsd: Drop reference in expkey_parse error cases
Drop reference to export key on error. Compile tested.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r-- | fs/nfsd/export.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 9dc036f18356..7ce2c6e4e23e 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -151,8 +151,10 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
151 | 151 | ||
152 | /* now we want a pathname, or empty meaning NEGATIVE */ | 152 | /* now we want a pathname, or empty meaning NEGATIVE */ |
153 | err = -EINVAL; | 153 | err = -EINVAL; |
154 | if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) | 154 | if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) { |
155 | cache_put(&ek->h, &svc_expkey_cache); | ||
155 | goto out; | 156 | goto out; |
157 | } | ||
156 | dprintk("Path seems to be <%s>\n", buf); | 158 | dprintk("Path seems to be <%s>\n", buf); |
157 | err = 0; | 159 | err = 0; |
158 | if (len == 0) { | 160 | if (len == 0) { |
@@ -164,8 +166,10 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
164 | } else { | 166 | } else { |
165 | struct nameidata nd; | 167 | struct nameidata nd; |
166 | err = path_lookup(buf, 0, &nd); | 168 | err = path_lookup(buf, 0, &nd); |
167 | if (err) | 169 | if (err) { |
170 | cache_put(&ek->h, &svc_expkey_cache); | ||
168 | goto out; | 171 | goto out; |
172 | } | ||
169 | 173 | ||
170 | dprintk("Found the path %s\n", buf); | 174 | dprintk("Found the path %s\n", buf); |
171 | key.ek_path = nd.path; | 175 | key.ek_path = nd.path; |