summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-18 16:28:05 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-18 16:28:05 -0500
commit14ace024b1e16d2bb9445c8387494fbbd820a738 (patch)
treeaff02ba8b2f86894cea54ab308c28e9cc04fe979 /net/sunrpc
parent55639353a0035052d9ea6cfe4dde0ac7fcbb2c9f (diff)
downloadkernel-crypto-14ace024b1e16d2bb9445c8387494fbbd820a738.tar.gz
kernel-crypto-14ace024b1e16d2bb9445c8387494fbbd820a738.tar.xz
kernel-crypto-14ace024b1e16d2bb9445c8387494fbbd820a738.zip
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index ef45eba2248..2deb0ed72ff 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -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))