From: Krishna Kumar Date: Mon, 20 Oct 2008 06:14:40 +0000 (+0530) Subject: nfsd: Drop reference in expkey_parse error cases X-Git-Tag: v2.6.28-rc1~31^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6dfcde98a299196f13dd66417663a819f0ac4156;p=linux-2.6-omap-h63xx.git nfsd: Drop reference in expkey_parse error cases Drop reference to export key on error. Compile tested. Signed-off-by: Krishna Kumar Signed-off-by: J. Bruce Fields --- 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;