summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-05-03 15:30:09 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-05-09 23:26:56 +0300
commitfe31ce83cbac7adcaa629b59179f502981be5f8b (patch)
tree0868b0ee3edac9a14085caa24e0c9982b412690d /net
parent9c5948c248696ca60c56ec5a608e225c4ab8a854 (diff)
downloadlinux-fe31ce83cbac7adcaa629b59179f502981be5f8b.tar.xz
SUNRPC: Fix an error code in gss_alloc_msg()
If kstrdup_const() then this function returns zero (success) but it should return -ENOMEM. Fixes: ac83228a7101 ("SUNRPC: Use namespace of listening daemon in the client AUTH_GSS upcall") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index b2cbc83d39c7..06fe17c2aea1 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -553,8 +553,10 @@ gss_alloc_msg(struct gss_auth *gss_auth,
gss_msg->auth = gss_auth;
if (service_name) {
gss_msg->service_name = kstrdup_const(service_name, GFP_NOFS);
- if (!gss_msg->service_name)
+ if (!gss_msg->service_name) {
+ err = -ENOMEM;
goto err_put_pipe_version;
+ }
}
return gss_msg;
err_put_pipe_version: