diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-02-16 13:28:01 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-02-16 13:28:01 -0500 |
commit | e9776d0f4adee8877145672f6416b06b57f2dc27 (patch) | |
tree | f7c1434c23fde65646c7c0a47498e06f94ba201a /net/sunrpc | |
parent | 9eb2ddb48ce3a7bd745c14a933112994647fa3cd (diff) |
SUNRPC: Fix a pipe_version reference leak
In gss_alloc_msg(), if the call to gss_encode_v1_msg() fails, we
want to release the reference to the pipe_version that was obtained
earlier in the function.
Fixes: 9d3a2260f0f4b (SUNRPC: Fix buffer overflow checking in...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 1ba1fd114912..36e431ee1c90 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -500,10 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth, | |||
500 | default: | 500 | default: |
501 | err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name); | 501 | err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name); |
502 | if (err) | 502 | if (err) |
503 | goto err_free_msg; | 503 | goto err_put_pipe_version; |
504 | }; | 504 | }; |
505 | kref_get(&gss_auth->kref); | 505 | kref_get(&gss_auth->kref); |
506 | return gss_msg; | 506 | return gss_msg; |
507 | err_put_pipe_version: | ||
508 | put_pipe_version(gss_auth->net); | ||
507 | err_free_msg: | 509 | err_free_msg: |
508 | kfree(gss_msg); | 510 | kfree(gss_msg); |
509 | err: | 511 | err: |