diff options
author | Krishna Kumar <krkumar2@in.ibm.com> | 2008-10-20 11:44:40 +0530 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-22 14:04:34 -0400 |
commit | 6dfcde98a299196f13dd66417663a819f0ac4156 (patch) | |
tree | 78c2d21004ec9216784d264bdcc7b8b2692660f8 /fs/nfsd | |
parent | 6c6a426fdcb374b7641d7cf9eea88410828b9d9a (diff) | |
download | kernel-crypto-6dfcde98a299196f13dd66417663a819f0ac4156.tar.gz kernel-crypto-6dfcde98a299196f13dd66417663a819f0ac4156.tar.xz kernel-crypto-6dfcde98a299196f13dd66417663a819f0ac4156.zip |
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')
-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 9dc036f1835..7ce2c6e4e23 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) /* now we want a pathname, or empty meaning NEGATIVE */ err = -EINVAL; - if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) + if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) { + cache_put(&ek->h, &svc_expkey_cache); goto out; + } dprintk("Path seems to be <%s>\n", buf); err = 0; if (len == 0) { @@ -164,8 +166,10 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) } else { struct nameidata nd; err = path_lookup(buf, 0, &nd); - if (err) + if (err) { + cache_put(&ek->h, &svc_expkey_cache); goto out; + } dprintk("Found the path %s\n", buf); key.ek_path = nd.path; |