mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
SUNRPC: Fix up an error return value in gss_import_sec_context_kerberos()
commit 14ace024b1 upstream.
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...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
eb0b93d6e2
commit
e64b13f627
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user