All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] nfs: Fix a memory leak when meeting an unsupported state protect
@ 2015-07-01  3:54 Kinglong Mee
  2015-07-01  3:55 ` [PATCH 2/8] nfs: Remove unused argument in nfs_server_set_fsinfo() Kinglong Mee
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Kinglong Mee @ 2015-07-01  3:54 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs@vger.kernel.org, kinglongmee

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/nfs4proc.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 55e1e3a..f1e0843 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6885,7 +6885,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,
 		/* unsupported! */
 		WARN_ON_ONCE(1);
 		status = -EINVAL;
-		goto out_server_scope;
+		goto out_impl_id;
 	}
 
 	status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
@@ -6913,6 +6913,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,
 		/* use the most recent implementation id */
 		kfree(clp->cl_implid);
 		clp->cl_implid = res.impl_id;
+		res.impl_id = NULL;
 
 		if (clp->cl_serverscope != NULL &&
 		    !nfs41_same_server_scope(clp->cl_serverscope,
@@ -6926,15 +6927,16 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,
 
 		if (clp->cl_serverscope == NULL) {
 			clp->cl_serverscope = res.server_scope;
-			goto out;
+			res.server_scope = NULL;
 		}
-	} else
-		kfree(res.impl_id);
+	}
 
-out_server_owner:
-	kfree(res.server_owner);
+out_impl_id:
+	kfree(res.impl_id);
 out_server_scope:
 	kfree(res.server_scope);
+out_server_owner:
+	kfree(res.server_owner);
 out:
 	if (clp->cl_implid != NULL)
 		dprintk("NFS reply exchange_id: Server Implementation ID: "
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-07-01 15:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01  3:54 [PATCH 1/8] nfs: Fix a memory leak when meeting an unsupported state protect Kinglong Mee
2015-07-01  3:55 ` [PATCH 2/8] nfs: Remove unused argument in nfs_server_set_fsinfo() Kinglong Mee
2015-07-01  3:56 ` [PATCH 3/8] nfs: Use remove_proc_subtree() instead remove_proc_entry() Kinglong Mee
2015-07-01  5:20   ` Al Viro
2015-07-01 14:58     ` Kinglong Mee
2015-07-01 15:00     ` [PATCH 3/8 v2] " Kinglong Mee
2015-07-01  3:57 ` [PATCH 4/8] nfs: Don't setting FILE_CREATED flags always Kinglong Mee
2015-07-01  3:58 ` [PATCH 5/8] nfs: Remove unneeded micro checking of CONFIG_PROC_FS Kinglong Mee
2015-07-01  3:59 ` [PATCH 6/8] nfs: Drop bad comment in nfs41_walk_client_list() Kinglong Mee
2015-07-01  3:59 ` [PATCH 7/8] nfs: Remove invalid NFS_ATTR_FATTR_V4_REFERRAL checking in nfs4_get_rootfh Kinglong Mee
2015-07-01  4:00 ` [PATCH 8/8] nfs: Remove invalid tk_pid from debug message Kinglong Mee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.