Commit e2b6d02c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  nfs: fix oops in nfs_rename()
  sunrpc: fix build-time warning
  sunrpc: on successful gss error pipe write, don't return error
  SUNRPC: Fix the return value in gss_import_sec_context()
  SUNRPC: Fix up an error return value in gss_import_sec_context_kerberos()
parents 9035a645 56335936
...@@ -1615,6 +1615,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1615,6 +1615,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out; goto out;
new_dentry = dentry; new_dentry = dentry;
rehash = NULL;
new_inode = NULL; new_inode = NULL;
} }
} }
......
...@@ -644,7 +644,22 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) ...@@ -644,7 +644,22 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); p = gss_fill_context(p, end, ctx, gss_msg->auth->mech);
if (IS_ERR(p)) { if (IS_ERR(p)) {
err = PTR_ERR(p); err = PTR_ERR(p);
gss_msg->msg.errno = (err == -EAGAIN) ? -EAGAIN : -EACCES; switch (err) {
case -EACCES:
gss_msg->msg.errno = err;
err = mlen;
break;
case -EFAULT:
case -ENOMEM:
case -EINVAL:
case -ENOSYS:
gss_msg->msg.errno = -EAGAIN;
break;
default:
printk(KERN_CRIT "%s: bad return from "
"gss_fill_context: %zd\n", __func__, err);
BUG();
}
goto err_release_msg; goto err_release_msg;
} }
gss_msg->ctx = gss_get_ctx(ctx); gss_msg->ctx = gss_get_ctx(ctx);
......
...@@ -131,8 +131,10 @@ gss_import_sec_context_kerberos(const void *p, ...@@ -131,8 +131,10 @@ gss_import_sec_context_kerberos(const void *p,
struct krb5_ctx *ctx; struct krb5_ctx *ctx;
int tmp; int tmp;
if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS))) if (!(ctx = kzalloc(sizeof(*ctx), GFP_NOFS))) {
p = ERR_PTR(-ENOMEM);
goto out_err; goto out_err;
}
p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate));
if (IS_ERR(p)) if (IS_ERR(p))
......
...@@ -252,7 +252,7 @@ gss_import_sec_context(const void *input_token, size_t bufsize, ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment