diff options
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 9 | ||||
-rw-r--r-- | net/sunrpc/sunrpc_syms.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index ad39b47e05bc..a2f1893bde53 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -845,6 +845,8 @@ init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) | |||
845 | 845 | ||
846 | int register_rpc_pipefs(void) | 846 | int register_rpc_pipefs(void) |
847 | { | 847 | { |
848 | int err; | ||
849 | |||
848 | rpc_inode_cachep = kmem_cache_create("rpc_inode_cache", | 850 | rpc_inode_cachep = kmem_cache_create("rpc_inode_cache", |
849 | sizeof(struct rpc_inode), | 851 | sizeof(struct rpc_inode), |
850 | 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| | 852 | 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| |
@@ -852,7 +854,12 @@ int register_rpc_pipefs(void) | |||
852 | init_once, NULL); | 854 | init_once, NULL); |
853 | if (!rpc_inode_cachep) | 855 | if (!rpc_inode_cachep) |
854 | return -ENOMEM; | 856 | return -ENOMEM; |
855 | register_filesystem(&rpc_pipe_fs_type); | 857 | err = register_filesystem(&rpc_pipe_fs_type); |
858 | if (err) { | ||
859 | kmem_cache_destroy(rpc_inode_cachep); | ||
860 | return err; | ||
861 | } | ||
862 | |||
856 | return 0; | 863 | return 0; |
857 | } | 864 | } |
858 | 865 | ||
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 43ecf62f12ef..0d35bc796d00 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
@@ -146,9 +146,11 @@ init_sunrpc(void) | |||
146 | int err = register_rpc_pipefs(); | 146 | int err = register_rpc_pipefs(); |
147 | if (err) | 147 | if (err) |
148 | goto out; | 148 | goto out; |
149 | err = rpc_init_mempool() != 0; | 149 | err = rpc_init_mempool(); |
150 | if (err) | 150 | if (err) { |
151 | unregister_rpc_pipefs(); | ||
151 | goto out; | 152 | goto out; |
153 | } | ||
152 | #ifdef RPC_DEBUG | 154 | #ifdef RPC_DEBUG |
153 | rpc_register_sysctl(); | 155 | rpc_register_sysctl(); |
154 | #endif | 156 | #endif |