]> err.no Git - linux-2.6/blobdiff - net/sunrpc/auth.c
[PATCH] sunrpc: cache_register can use wrong module reference
[linux-2.6] / net / sunrpc / auth.c
index 9bcec9b927b9bc9e1cc1b6088f228ab92da59b02..505e2d4b3d6259e3363c8a1c428da3535533132a 100644 (file)
@@ -66,10 +66,10 @@ rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
        u32                     flavor = pseudoflavor_to_flavor(pseudoflavor);
 
        if (flavor >= RPC_AUTH_MAXFLAVOR || !(ops = auth_flavors[flavor]))
-               return NULL;
+               return ERR_PTR(-EINVAL);
        auth = ops->create(clnt, pseudoflavor);
-       if (!auth)
-               return NULL;
+       if (IS_ERR(auth))
+               return auth;
        if (clnt->cl_auth)
                rpcauth_destroy(clnt->cl_auth);
        clnt->cl_auth = auth;