X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsunrpc%2Fauth.c;h=ea640fb7e0a9f76b0d154e9b5c8a1b494b144a50;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=d6ba6ef51e3713a3479d1d7731ea8998ff751141;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index d6ba6ef51..ea640fb7e 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -65,26 +65,14 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt) struct rpc_authops *ops; u32 flavor = pseudoflavor_to_flavor(pseudoflavor); - 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; + if (flavor >= RPC_AUTH_MAXFLAVOR || !(ops = auth_flavors[flavor])) + return ERR_PTR(-EINVAL); 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; }