summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/export.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-04-22 11:30:59 +0200
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-04-22 12:03:02 -0400
commitd03859a4aca3969efd91dc77be7efa2ae45b05d8 (patch)
treed0cef571e89763223e133315233333bb1a8f128d /fs/nfsd/export.c
parent5771635592267758e7dc5647f2a0088aa6244159 (diff)
downloadlinux-d03859a4aca3969efd91dc77be7efa2ae45b05d8.tar.bz2
nfsd: potential ERR_PTR dereference on exp_export() error paths.
We "goto finish" from several places where "exp" is an ERR_PTR. Also I changed the check for "fsid_key" so that it was consistent with the check I added. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r--fs/nfsd/export.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 65ddc5b8eb33..55da4d339293 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1076,9 +1076,9 @@ exp_export(struct nfsctl_export *nxp)
err = 0;
finish:
kfree(new.ex_pathname);
- if (exp)
+ if (!IS_ERR_OR_NULL(exp))
exp_put(exp);
- if (fsid_key && !IS_ERR(fsid_key))
+ if (!IS_ERR_OR_NULL(fsid_key))
cache_put(&fsid_key->h, &svc_expkey_cache);
path_put(&path);
out_put_clp: