Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b891e4a0 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Fix the return value in gss_import_sec_context()



If the context allocation fails, it will return GSS_S_FAILURE, which is
neither a valid error code, nor is it even negative.

Return ENOMEM instead...

Reported-by: default avatarJeff Layton <jlayton@redhat.com>
Cc: stable@kernel.org
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 14ace024
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -252,7 +252,7 @@ gss_import_sec_context(const void *input_token, size_t bufsize,
		       struct gss_ctx		**ctx_id)
		       struct gss_ctx		**ctx_id)
{
{
	if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL)))
	if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL)))
		return GSS_S_FAILURE;
		return -ENOMEM;
	(*ctx_id)->mech_type = gss_mech_get(mech);
	(*ctx_id)->mech_type = gss_mech_get(mech);


	return mech->gm_ops
	return mech->gm_ops