X-Git-Url: http://git.onelab.eu/?p=linux-2.6.git;a=blobdiff_plain;f=net%2Fsunrpc%2Fauth.c;fp=net%2Fsunrpc%2Fauth.c;h=9c893efe809fa10392f07de4a535cee009263e48;hp=a3ea89579eab15cf1a88c38cf9b2ad7c212899f8;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index a3ea89579..9c893efe8 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; }