mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
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: 9d3a2260f0
(SUNRPC: Fix buffer overflow checking in...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
9eb2ddb48c
commit
e9776d0f4a
1 changed files with 3 additions and 1 deletions
|
@ -500,10 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth,
|
|||
default:
|
||||
err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
|
||||
if (err)
|
||||
goto err_free_msg;
|
||||
goto err_put_pipe_version;
|
||||
};
|
||||
kref_get(&gss_auth->kref);
|
||||
return gss_msg;
|
||||
err_put_pipe_version:
|
||||
put_pipe_version(gss_auth->net);
|
||||
err_free_msg:
|
||||
kfree(gss_msg);
|
||||
err:
|
||||
|
|
Loading…
Reference in a new issue