linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSv4: fix memory leak if nfs4_begin_drain_session fails
@ 2019-09-20  0:22 Navid Emamdoost
  2019-11-06  5:37 ` Navid Emamdoost
  0 siblings, 1 reply; 3+ messages in thread
From: Navid Emamdoost @ 2019-09-20  0:22 UTC (permalink / raw)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Trond Myklebust,
	Anna Schumaker, linux-nfs, linux-kernel

In nfs4_try_migration, if nfs4_begin_drain_session fails the allocated
memory should be released.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 fs/nfs/nfs4state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index cad4e064b328..124649f12067 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -2096,7 +2096,7 @@ static int nfs4_try_migration(struct nfs_server *server, const struct cred *cred
 
 	status = nfs4_begin_drain_session(clp);
 	if (status != 0)
-		return status;
+		goto out;
 
 	status = nfs4_replace_transport(server, locations);
 	if (status != 0) {
-- 
2.17.1


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

end of thread, other threads:[~2019-11-12 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20  0:22 [PATCH] NFSv4: fix memory leak if nfs4_begin_drain_session fails Navid Emamdoost
2019-11-06  5:37 ` Navid Emamdoost
2019-11-12 18:47   ` Schumaker, Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).