Skip to content

Commit d03859a

Browse files
error27J. Bruce Fields
authored andcommitted
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>
1 parent 5771635 commit d03859a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/nfsd/export.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,9 @@ exp_export(struct nfsctl_export *nxp)
10761076
err = 0;
10771077
finish:
10781078
kfree(new.ex_pathname);
1079-
if (exp)
1079+
if (!IS_ERR_OR_NULL(exp))
10801080
exp_put(exp);
1081-
if (fsid_key && !IS_ERR(fsid_key))
1081+
if (!IS_ERR_OR_NULL(fsid_key))
10821082
cache_put(&fsid_key->h, &svc_expkey_cache);
10831083
path_put(&path);
10841084
out_put_clp:

0 commit comments

Comments
 (0)