Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d03859a4 authored by Dan Carpenter's avatar Dan Carpenter Committed by J. Bruce Fields
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 57716355
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1076,9 +1076,9 @@ exp_export(struct nfsctl_export *nxp)
		err = 0;
		err = 0;
finish:
finish:
	kfree(new.ex_pathname);
	kfree(new.ex_pathname);
	if (exp)
	if (!IS_ERR_OR_NULL(exp))
		exp_put(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);
		cache_put(&fsid_key->h, &svc_expkey_cache);
	path_put(&path);
	path_put(&path);
out_put_clp:
out_put_clp: