summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-06-02 15:01:53 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-05 02:59:01 -0700
commit5441db69f8562a0daa9e6d82aa4279ded0d6e649 (patch)
treed45e78029da59d2452731fcc4018c1dc62405fb1 /rpc
parentbf3a6dcdf3c8a8a64e7c864b56c4d9be60fca8e6 (diff)
rpc: call transport_unref only on non-NULL transport
BUG: 1227583 Change-Id: Ifac4dd8c633081483e4eba9d7e5a89837b2a453a Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/11041 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index ebcfec73cef..567ff35b86a 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -1630,10 +1630,16 @@ rpc_clnt_trigger_destroy (struct rpc_clnt *rpc)
if (!rpc)
return;
+ /* reading conn->trans outside conn->lock is OK, since this is the last
+ * ref*/
conn = &rpc->conn;
trans = conn->trans;
- rpc_clnt_disable (rpc);
- rpc_transport_unref (trans);
+ rpc_clnt_disconnect (rpc);
+
+ /* This is to account for rpc_clnt_disable that might have been called
+ * before rpc_clnt_unref */
+ if (trans)
+ rpc_transport_unref (trans);
}
static void