aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust2013-04-04 14:55:00 -0500
committerGreg Kroah-Hartman2013-04-12 11:52:10 -0500
commitc80a1c58deeac0c21cbf8d952c1bd08f1afbe8ed (patch)
tree8010ff3262fb4bc9b3c196e25f45115b6fdc0fa2 /fs
parent020dff84998201602ae4d00bd38acafc62f5c693 (diff)
downloadkernel-omap-c80a1c58deeac0c21cbf8d952c1bd08f1afbe8ed.tar.gz
kernel-omap-c80a1c58deeac0c21cbf8d952c1bd08f1afbe8ed.tar.xz
kernel-omap-c80a1c58deeac0c21cbf8d952c1bd08f1afbe8ed.zip
NFSv4: Fix a memory leak in nfs4_discover_server_trunking
commit b193d59a4863ea670872d76dc99231ddeb598625 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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index e61f68d5ef21..994fbe2c714c 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1877,7 +1877,13 @@ again:
1877 status = PTR_ERR(clnt); 1877 status = PTR_ERR(clnt);
1878 break; 1878 break;
1879 } 1879 }
1880 clp->cl_rpcclient = clnt; 1880 /* Note: this is safe because we haven't yet marked the
1881 * client as ready, so we are the only user of
1882 * clp->cl_rpcclient
1883 */
1884 clnt = xchg(&clp->cl_rpcclient, clnt);
1885 rpc_shutdown_client(clnt);
1886 clnt = clp->cl_rpcclient;
1881 goto again; 1887 goto again;
1882 1888
1883 case -NFS4ERR_MINOR_VERS_MISMATCH: 1889 case -NFS4ERR_MINOR_VERS_MISMATCH: