diff options
| author | Steve French <sfrench@us.ibm.com> | 2006-03-30 22:35:56 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2006-03-30 22:35:56 -0500 |
| commit | d62e54abca1146981fc9f98f85ff398a113a22c2 (patch) | |
| tree | 870420dbc4c65e716dcef8a802aafdc0ef97a8b4 /net/sunrpc/auth.c | |
| parent | fd4a0b92db6a57cba8d03efbe1cebf91f9124ce0 (diff) | |
| parent | ce362c009250340358a7221f3cdb7954cbf19c01 (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'net/sunrpc/auth.c')
| -rw-r--r-- | net/sunrpc/auth.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 8d6f1a176b15..55163af3dcaf 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
| @@ -64,14 +64,26 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt) | |||
| 64 | struct rpc_authops *ops; | 64 | struct rpc_authops *ops; |
| 65 | u32 flavor = pseudoflavor_to_flavor(pseudoflavor); | 65 | u32 flavor = pseudoflavor_to_flavor(pseudoflavor); |
| 66 | 66 | ||
| 67 | if (flavor >= RPC_AUTH_MAXFLAVOR || !(ops = auth_flavors[flavor])) | 67 | auth = ERR_PTR(-EINVAL); |
| 68 | return ERR_PTR(-EINVAL); | 68 | if (flavor >= RPC_AUTH_MAXFLAVOR) |
| 69 | goto out; | ||
| 70 | |||
| 71 | /* FIXME - auth_flavors[] really needs an rw lock, | ||
| 72 | * and module refcounting. */ | ||
| 73 | #ifdef CONFIG_KMOD | ||
| 74 | if ((ops = auth_flavors[flavor]) == NULL) | ||
| 75 | request_module("rpc-auth-%u", flavor); | ||
| 76 | #endif | ||
| 77 | if ((ops = auth_flavors[flavor]) == NULL) | ||
| 78 | goto out; | ||
| 69 | auth = ops->create(clnt, pseudoflavor); | 79 | auth = ops->create(clnt, pseudoflavor); |
| 70 | if (IS_ERR(auth)) | 80 | if (IS_ERR(auth)) |
| 71 | return auth; | 81 | return auth; |
| 72 | if (clnt->cl_auth) | 82 | if (clnt->cl_auth) |
| 73 | rpcauth_destroy(clnt->cl_auth); | 83 | rpcauth_destroy(clnt->cl_auth); |
| 74 | clnt->cl_auth = auth; | 84 | clnt->cl_auth = auth; |
| 85 | |||
| 86 | out: | ||
| 75 | return auth; | 87 | return auth; |
| 76 | } | 88 | } |
| 77 | 89 | ||
