diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-07-29 17:37:40 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-08-03 16:57:26 -0400 |
commit | 5c3e985a2c1908aa97221d3806f85ce7e2fbfa88 (patch) | |
tree | 5ffae9134b9ce0ee1c92324d3483963a5b3e075d /net/sunrpc/rpc_pipe.c | |
parent | e0ab53deaa91293a7958d63d5a2cf4c5645ad6f0 (diff) |
SUNRPC: Fix obvious refcounting bugs in rpc_pipefs.
Doh!
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index dc6cb93c8830..a3bd2db2e024 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -667,10 +667,11 @@ rpc_mkdir(char *path, struct rpc_clnt *rpc_client) | |||
667 | RPCAUTH_info, RPCAUTH_EOF); | 667 | RPCAUTH_info, RPCAUTH_EOF); |
668 | if (error) | 668 | if (error) |
669 | goto err_depopulate; | 669 | goto err_depopulate; |
670 | dget(dentry); | ||
670 | out: | 671 | out: |
671 | mutex_unlock(&dir->i_mutex); | 672 | mutex_unlock(&dir->i_mutex); |
672 | rpc_release_path(&nd); | 673 | rpc_release_path(&nd); |
673 | return dget(dentry); | 674 | return dentry; |
674 | err_depopulate: | 675 | err_depopulate: |
675 | rpc_depopulate(dentry); | 676 | rpc_depopulate(dentry); |
676 | __rpc_rmdir(dir, dentry); | 677 | __rpc_rmdir(dir, dentry); |
@@ -731,10 +732,11 @@ rpc_mkpipe(char *path, void *private, struct rpc_pipe_ops *ops, int flags) | |||
731 | rpci->flags = flags; | 732 | rpci->flags = flags; |
732 | rpci->ops = ops; | 733 | rpci->ops = ops; |
733 | inode_dir_notify(dir, DN_CREATE); | 734 | inode_dir_notify(dir, DN_CREATE); |
735 | dget(dentry); | ||
734 | out: | 736 | out: |
735 | mutex_unlock(&dir->i_mutex); | 737 | mutex_unlock(&dir->i_mutex); |
736 | rpc_release_path(&nd); | 738 | rpc_release_path(&nd); |
737 | return dget(dentry); | 739 | return dentry; |
738 | err_dput: | 740 | err_dput: |
739 | dput(dentry); | 741 | dput(dentry); |
740 | dentry = ERR_PTR(-ENOMEM); | 742 | dentry = ERR_PTR(-ENOMEM); |