From cea1b4c35075b429a26e5edf792c2787fb77e7a3 Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Mon, 20 Mar 2006 13:44:08 -0500 Subject: [PATCH] --- yaml --- r: 23865 b: refs/heads/master c: f344f6df4b2baa3e5c553c461735dfaf92f44be7 h: refs/heads/master i: 23863: 85301a7690893d1cddc32683358eef02eb1988ac v: v3 --- [refs] | 2 +- trunk/net/sunrpc/auth.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 6b7024463da1..1444a35fe087 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb374d24f225f38f13dbffb65dd7ec72daf08dba +refs/heads/master: f344f6df4b2baa3e5c553c461735dfaf92f44be7 diff --git a/trunk/net/sunrpc/auth.c b/trunk/net/sunrpc/auth.c index 8d6f1a176b15..55163af3dcaf 100644 --- a/trunk/net/sunrpc/auth.c +++ b/trunk/net/sunrpc/auth.c @@ -64,14 +64,26 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt) struct rpc_authops *ops; u32 flavor = pseudoflavor_to_flavor(pseudoflavor); - if (flavor >= RPC_AUTH_MAXFLAVOR || !(ops = auth_flavors[flavor])) - return ERR_PTR(-EINVAL); + auth = ERR_PTR(-EINVAL); + if (flavor >= RPC_AUTH_MAXFLAVOR) + goto out; + + /* FIXME - auth_flavors[] really needs an rw lock, + * and module refcounting. */ +#ifdef CONFIG_KMOD + if ((ops = auth_flavors[flavor]) == NULL) + request_module("rpc-auth-%u", flavor); +#endif + if ((ops = auth_flavors[flavor]) == NULL) + goto out; auth = ops->create(clnt, pseudoflavor); if (IS_ERR(auth)) return auth; if (clnt->cl_auth) rpcauth_destroy(clnt->cl_auth); clnt->cl_auth = auth; + +out: return auth; }