diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-07-31 14:29:07 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-08-04 08:52:57 -0400 |
commit | 5d8d9a4d9ff74c55901642b4e2ac5124830ddafe (patch) | |
tree | 9f171aa61048cf5c154597466af21ea7c4d701a2 /net/sunrpc/auth.c | |
parent | d05dd4e98f0dd30ee933e05ac9363614c47df83a (diff) | |
download | kernel-common-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.tar.gz kernel-common-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.tar.bz2 kernel-common-5d8d9a4d9ff74c55901642b4e2ac5124830ddafe.zip |
NFS: Ensure the AUTH_UNIX credcache is allocated dynamically
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 73affb8624fa..db135543d21e 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -587,14 +587,27 @@ static struct shrinker rpc_cred_shrinker = { .seeks = DEFAULT_SEEKS, }; -void __init rpcauth_init_module(void) +int __init rpcauth_init_module(void) { - rpc_init_authunix(); - rpc_init_generic_auth(); + int err; + + err = rpc_init_authunix(); + if (err < 0) + goto out1; + err = rpc_init_generic_auth(); + if (err < 0) + goto out2; register_shrinker(&rpc_cred_shrinker); + return 0; +out2: + rpc_destroy_authunix(); +out1: + return err; } void __exit rpcauth_remove_module(void) { + rpc_destroy_authunix(); + rpc_destroy_generic_auth(); unregister_shrinker(&rpc_cred_shrinker); } |