]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SUNRPC: Fix the return value in gss_import_sec_context()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 18 Dec 2009 21:28:12 +0000 (16:28 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Jan 2010 18:19:20 +0000 (10:19 -0800)
commit b891e4a05ef6beac85465295a032431577c66b16 upstream.

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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sunrpc/auth_gss/gss_mech_switch.c

index 6efbb0cd3c7cd03d18b610fa3ee7a42a5ba97a5e..76e4c6f4ac3c1ad8f58f1f7a92bf7781d05b18a3 100644 (file)
@@ -252,7 +252,7 @@ gss_import_sec_context(const void *input_token, size_t bufsize,
                       struct gss_ctx           **ctx_id)
 {
        if (!(*ctx_id = kzalloc(sizeof(**ctx_id), GFP_KERNEL)))
-               return GSS_S_FAILURE;
+               return -ENOMEM;
        (*ctx_id)->mech_type = gss_mech_get(mech);
 
        return mech->gm_ops