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:
parent
bf3a6dcdf3
commit
5441db69f8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user