diff options
-rw-r--r-- | net/sunrpc/auth_gss/gss_rpc_xdr.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c index 5c4c61d527e2..a1e1b1ab515b 100644 --- a/net/sunrpc/auth_gss/gss_rpc_xdr.c +++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c | |||
@@ -264,25 +264,27 @@ static int gssx_dec_option_array(struct xdr_stream *xdr, | |||
264 | if (unlikely(p == NULL)) | 264 | if (unlikely(p == NULL)) |
265 | return -ENOSPC; | 265 | return -ENOSPC; |
266 | count = be32_to_cpup(p++); | 266 | count = be32_to_cpup(p++); |
267 | if (count != 0) { | 267 | if (!count) |
268 | /* we recognize only 1 currently: CREDS_VALUE */ | 268 | return 0; |
269 | oa->count = 1; | ||
270 | 269 | ||
271 | oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); | 270 | /* we recognize only 1 currently: CREDS_VALUE */ |
272 | if (!oa->data) | 271 | oa->count = 1; |
273 | return -ENOMEM; | ||
274 | 272 | ||
275 | creds = kmalloc(sizeof(struct svc_cred), GFP_KERNEL); | 273 | oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); |
276 | if (!creds) { | 274 | if (!oa->data) |
277 | kfree(oa->data); | 275 | return -ENOMEM; |
278 | return -ENOMEM; | ||
279 | } | ||
280 | 276 | ||
281 | oa->data[0].option.data = CREDS_VALUE; | 277 | creds = kmalloc(sizeof(struct svc_cred), GFP_KERNEL); |
282 | oa->data[0].option.len = sizeof(CREDS_VALUE); | 278 | if (!creds) { |
283 | oa->data[0].value.data = (void *)creds; | 279 | kfree(oa->data); |
284 | oa->data[0].value.len = 0; | 280 | return -ENOMEM; |
285 | } | 281 | } |
282 | |||
283 | oa->data[0].option.data = CREDS_VALUE; | ||
284 | oa->data[0].option.len = sizeof(CREDS_VALUE); | ||
285 | oa->data[0].value.data = (void *)creds; | ||
286 | oa->data[0].value.len = 0; | ||
287 | |||
286 | for (i = 0; i < count; i++) { | 288 | for (i = 0; i < count; i++) { |
287 | gssx_buffer dummy = { 0, NULL }; | 289 | gssx_buffer dummy = { 0, NULL }; |
288 | u32 length; | 290 | u32 length; |