diff options
author | Emmanuel Dreyfus <manu@netbsd.org> | 2014-09-06 02:57:41 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-16 04:32:43 -0700 |
commit | d18b830fb78a141f4c38a40be7c470485b9250ea (patch) | |
tree | 9929111d6b8627c7319ef5c4be68730f1cdc8b35 /rpc | |
parent | ac6b4eafee170ed00b44c9df2b96da47733bf8bf (diff) |
Do not call rpc_transport_unref() on NULL trans
rpc_clnt_disable() sets rpc->conn->trans to NULL, hence we should not
call rpc_transport_unref() afterwards. I moved it before the
rpc_clnt_disable() call, but I am not sure it should be called at all,
perhaps it should just go away.
This is a backport of I488d0207494e3a3fad52e64e67b2e740b236b864
BUG: 1138897
Change-Id: I001ab73b37f74ba98463bd9c32c01c670e9c7ad8
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8629
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index b831c537723..bb0df12e8b8 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1619,14 +1619,16 @@ rpc_clnt_ref (struct rpc_clnt *rpc) static void rpc_clnt_trigger_destroy (struct rpc_clnt *rpc) { - rpc_clnt_connection_t *conn = NULL; + rpc_clnt_connection_t *conn = NULL; + rpc_transport_t *trans = NULL; if (!rpc) return; conn = &rpc->conn; + trans = conn->trans; rpc_clnt_disable (rpc); - rpc_transport_unref (conn->trans); + rpc_transport_unref (trans); } static void |