mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
NFSv4: Fix a memory leak in nfs4_discover_server_trunking
commit b193d59a48 upstream.
When we assign a new rpc_client to clp->cl_rpcclient, we need to destroy
the old one.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
020dff8499
commit
c80a1c58de
@@ -1877,7 +1877,13 @@ again:
|
||||
status = PTR_ERR(clnt);
|
||||
break;
|
||||
}
|
||||
clp->cl_rpcclient = clnt;
|
||||
/* Note: this is safe because we haven't yet marked the
|
||||
* client as ready, so we are the only user of
|
||||
* clp->cl_rpcclient
|
||||
*/
|
||||
clnt = xchg(&clp->cl_rpcclient, clnt);
|
||||
rpc_shutdown_client(clnt);
|
||||
clnt = clp->cl_rpcclient;
|
||||
goto again;
|
||||
|
||||
case -NFS4ERR_MINOR_VERS_MISMATCH:
|
||||
|
||||
Reference in New Issue
Block a user