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>
This commit is contained in:
Krishnan Parthasarathi 2015-06-02 15:01:53 +05:30 committed by Raghavendra G
parent bf3a6dcdf3
commit 5441db69f8

View File

@ -1630,9 +1630,15 @@ 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_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);
}