public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Clear xpt_bc_xprt if xs_setup_bc_tcp failed
@ 2014-01-07  4:41 Kinglong Mee
  2014-01-07  5:01 ` Trond Myklebust
  0 siblings, 1 reply; 7+ messages in thread
From: Kinglong Mee @ 2014-01-07  4:41 UTC (permalink / raw)
  To: J. Bruce Fields, Trond Myklebust; +Cc: Linux NFS Mailing List

If try_module_get failed, xpt_bc_xprt should be set to NULL,
because xprt will be free.

Don't needed using xprt_put to free xprt, because it is always new.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 net/sunrpc/xprtsock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 4fcdf74..5ed124f 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2986,10 +2986,10 @@ static struct rpc_xprt *xs_setup_bc_tcp(struct xprt_create *args)
 	 */
 	xprt_set_connected(xprt);
 
-
 	if (try_module_get(THIS_MODULE))
 		return xprt;
-	xprt_put(xprt);
+
+	args->bc_xprt->xpt_bc_xprt = NULL;
 	ret = ERR_PTR(-EINVAL);
 out_err:
 	xs_xprt_free(xprt);
-- 
1.8.4.2

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

end of thread, other threads:[~2014-01-10  3:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07  4:41 [PATCH] SUNRPC: Clear xpt_bc_xprt if xs_setup_bc_tcp failed Kinglong Mee
2014-01-07  5:01 ` Trond Myklebust
2014-01-07  5:21   ` Kinglong Mee
2014-01-07  7:26   ` Kinglong Mee
2014-01-09 16:34     ` Dr Fields James Bruce
2014-01-10  2:43       ` Kinglong Mee
2014-01-10  3:22         ` Kinglong Mee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox