diff options
Diffstat (limited to 'net/sunrpc/auth_unix.c')
-rw-r--r-- | net/sunrpc/auth_unix.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 2f1bdb5c86b3..f17dabbab1c7 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
@@ -89,12 +89,14 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
89 | cred->uc_gids[i] = NOGROUP; | 89 | cred->uc_gids[i] = NOGROUP; |
90 | } | 90 | } |
91 | 91 | ||
92 | return (struct rpc_cred *) cred; | 92 | return &cred->uc_base; |
93 | } | 93 | } |
94 | 94 | ||
95 | static void | 95 | static void |
96 | unx_destroy_cred(struct rpc_cred *cred) | 96 | unx_destroy_cred(struct rpc_cred *rcred) |
97 | { | 97 | { |
98 | struct unx_cred *cred = container_of(rcred, struct unx_cred, uc_base); | ||
99 | |||
98 | kfree(cred); | 100 | kfree(cred); |
99 | } | 101 | } |
100 | 102 | ||
@@ -106,7 +108,7 @@ unx_destroy_cred(struct rpc_cred *cred) | |||
106 | static int | 108 | static int |
107 | unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags) | 109 | unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int flags) |
108 | { | 110 | { |
109 | struct unx_cred *cred = (struct unx_cred *) rcred; | 111 | struct unx_cred *cred = container_of(rcred, struct unx_cred, uc_base); |
110 | int i; | 112 | int i; |
111 | 113 | ||
112 | if (!(flags & RPCAUTH_LOOKUP_ROOTCREDS)) { | 114 | if (!(flags & RPCAUTH_LOOKUP_ROOTCREDS)) { |
@@ -137,7 +139,7 @@ static __be32 * | |||
137 | unx_marshal(struct rpc_task *task, __be32 *p) | 139 | unx_marshal(struct rpc_task *task, __be32 *p) |
138 | { | 140 | { |
139 | struct rpc_clnt *clnt = task->tk_client; | 141 | struct rpc_clnt *clnt = task->tk_client; |
140 | struct unx_cred *cred = (struct unx_cred *) task->tk_msg.rpc_cred; | 142 | struct unx_cred *cred = container_of(task->tk_msg.rpc_cred, struct unx_cred, uc_base); |
141 | __be32 *base, *hold; | 143 | __be32 *base, *hold; |
142 | int i; | 144 | int i; |
143 | 145 | ||