projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nfsd: Drop reference in expkey_parse error cases
[firefly-linux-kernel-4.4.55.git]
/
fs
/
nfsd
/
export.c
diff --git
a/fs/nfsd/export.c
b/fs/nfsd/export.c
index 9dc036f1835614e3c2505abad50496071cf8b0b2..7ce2c6e4e23ee11c5b2cfc0a2b056dbf6d57e6a1 100644
(file)
--- 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;
/* 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;
goto out;
+ }
dprintk("Path seems to be <%s>\n", buf);
err = 0;
if (len == 0) {
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);
} else {
struct nameidata nd;
err = path_lookup(buf, 0, &nd);
- if (err)
+ if (err) {
+ cache_put(&ek->h, &svc_expkey_cache);
goto out;
goto out;
+ }
dprintk("Found the path %s\n", buf);
key.ek_path = nd.path;
dprintk("Found the path %s\n", buf);
key.ek_path = nd.path;