Skip to content

Commit

Permalink
nfsd: potential ERR_PTR dereference on exp_export() error paths.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Apr 22, 2010
1 parent 5771635 commit d03859a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d03859a

Please sign in to comment.