Commit fe31ce83 authored by Dan Carpenter's avatar Dan Carpenter Committed by Anna Schumaker

SUNRPC: Fix an error code in gss_alloc_msg()

If kstrdup_const() then this function returns zero (success) but it
should return -ENOMEM.

Fixes: ac83228a ("SUNRPC: Use namespace of listening daemon in the client AUTH_GSS upcall")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 9c5948c2
......@@ -553,9 +553,11 @@ 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:
put_pipe_version(gss_auth->net);
......
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