提交 14ace024 编写于 作者: T Trond Myklebust

SUNRPC: Fix up an error return value in gss_import_sec_context_kerberos()

If the context allocation fails, the function currently returns a random
error code, since the variable 'p' still points to a valid memory location.

Ensure that it returns ENOMEM...

Cc: stable@kernel.org
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 55639353
......@@ -131,8 +131,10 @@ gss_import_sec_context_kerberos(const void *p,
struct krb5_ctx *ctx;
int tmp;
if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS)))
if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS))) {
p = ERR_PTR(-ENOMEM);
goto out_err;
}
p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate));
if (IS_ERR(p))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册