Commit e9776d0f authored by Trond Myklebust's avatar Trond Myklebust

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: 9d3a2260 (SUNRPC: Fix buffer overflow checking in...)
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 9eb2ddb4
...@@ -500,10 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth, ...@@ -500,10 +500,12 @@ gss_alloc_msg(struct gss_auth *gss_auth,
default: default:
err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name); err = gss_encode_v1_msg(gss_msg, service_name, gss_auth->target_name);
if (err) if (err)
goto err_free_msg; goto err_put_pipe_version;
}; };
kref_get(&gss_auth->kref); kref_get(&gss_auth->kref);
return gss_msg; return gss_msg;
err_put_pipe_version:
put_pipe_version(gss_auth->net);
err_free_msg: err_free_msg:
kfree(gss_msg); kfree(gss_msg);
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment