diff options
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 3c3c50f38a1c..66cb89c18347 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -644,7 +644,22 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) | |||
644 | p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); | 644 | p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); |
645 | if (IS_ERR(p)) { | 645 | if (IS_ERR(p)) { |
646 | err = PTR_ERR(p); | 646 | err = PTR_ERR(p); |
647 | gss_msg->msg.errno = (err == -EAGAIN) ? -EAGAIN : -EACCES; | 647 | switch (err) { |
648 | case -EACCES: | ||
649 | gss_msg->msg.errno = err; | ||
650 | err = mlen; | ||
651 | break; | ||
652 | case -EFAULT: | ||
653 | case -ENOMEM: | ||
654 | case -EINVAL: | ||
655 | case -ENOSYS: | ||
656 | gss_msg->msg.errno = -EAGAIN; | ||
657 | break; | ||
658 | default: | ||
659 | printk(KERN_CRIT "%s: bad return from " | ||
660 | "gss_fill_context: %ld\n", __func__, err); | ||
661 | BUG(); | ||
662 | } | ||
648 | goto err_release_msg; | 663 | goto err_release_msg; |
649 | } | 664 | } |
650 | gss_msg->ctx = gss_get_ctx(ctx); | 665 | gss_msg->ctx = gss_get_ctx(ctx); |