From: Dan Carpenter Date: Thu, 22 Apr 2010 09:30:59 +0000 (+0200) Subject: nfsd: potential ERR_PTR dereference on exp_export() error paths. X-Git-Tag: v2.6.35-rc1~489^2~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d03859a4aca3969efd91dc77be7efa2ae45b05d8;p=karo-tx-linux.git 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 Signed-off-by: J. Bruce Fields --- 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: