From: Trond Myklebust Date: Fri, 18 Dec 2009 21:28:12 +0000 (-0500) Subject: SUNRPC: Fix the return value in gss_import_sec_context() X-Git-Tag: 2.1b_release~9748^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b891e4a05ef6beac85465295a032431577c66b16;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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: Jeff Layton Cc: stable@kernel.org Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index 6efbb0c..76e4c6f 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c @@ -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