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

Commit 5c3e985a authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Fix obvious refcounting bugs in rpc_pipefs.



Doh!

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)
parent e0ab53de
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -667,10 +667,11 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client)
			RPCAUTH_info, RPCAUTH_EOF);
			RPCAUTH_info, RPCAUTH_EOF);
	if (error)
	if (error)
		goto err_depopulate;
		goto err_depopulate;
	dget(dentry);
out:
out:
	mutex_unlock(&dir->i_mutex);
	mutex_unlock(&dir->i_mutex);
	rpc_release_path(&nd);
	rpc_release_path(&nd);
	return dget(dentry);
	return dentry;
err_depopulate:
err_depopulate:
	rpc_depopulate(dentry);
	rpc_depopulate(dentry);
	__rpc_rmdir(dir, dentry);
	__rpc_rmdir(dir, dentry);
@@ -731,10 +732,11 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags)
	rpci->flags = flags;
	rpci->flags = flags;
	rpci->ops = ops;
	rpci->ops = ops;
	inode_dir_notify(dir, DN_CREATE);
	inode_dir_notify(dir, DN_CREATE);
	dget(dentry);
out:
out:
	mutex_unlock(&dir->i_mutex);
	mutex_unlock(&dir->i_mutex);
	rpc_release_path(&nd);
	rpc_release_path(&nd);
	return dget(dentry);
	return dentry;
err_dput:
err_dput:
	dput(dentry);
	dput(dentry);
	dentry = ERR_PTR(-ENOMEM);
	dentry = ERR_PTR(-ENOMEM);