summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sunrpc_syms.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2007-05-09 02:34:51 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 12:30:54 -0700
commit5bd5f5812bfa753218e02cb773e06ede48055798 (patch)
tree266b416bca305ff32cf121490d31fd1b6bf32a75 /net/sunrpc/sunrpc_syms.c
parentcd123012d99fde4759500fee611e724e4f3016e3 (diff)
downloadop-kernel-dev-5bd5f5812bfa753218e02cb773e06ede48055798.zip
op-kernel-dev-5bd5f5812bfa753218e02cb773e06ede48055798.tar.gz
sunrpc: fix error path in module_init
register_rpc_pipefs() needs to clean up rpc_inode_cache by kmem_cache_destroy() on register_filesystem() failure. init_sunrpc() needs to unregister rpc_pipe_fs by unregister_rpc_pipefs() when rpc_init_mempool() returns error. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Neil Brown <neilb@suse.de> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/sunrpc/sunrpc_syms.c')
-rw-r--r--net/sunrpc/sunrpc_syms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 43ecf62..0d35bc79 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -146,9 +146,11 @@ init_sunrpc(void)
int err = register_rpc_pipefs();
if (err)
goto out;
- err = rpc_init_mempool() != 0;
- if (err)
+ err = rpc_init_mempool();
+ if (err) {
+ unregister_rpc_pipefs();
goto out;
+ }
#ifdef RPC_DEBUG
rpc_register_sysctl();
#endif
OpenPOWER on IntegriCloud