summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/rdma/src
diff options
context:
space:
mode:
authorMark Lipscombe <mlipscombe@gmail.com>2015-02-27 15:36:48 -0800
committerVijay Bellur <vbellur@redhat.com>2015-03-03 04:46:34 -0800
commit33214ef83684c3b025c773931c071f8af030242b (patch)
treeee63133c3814726d9ef6915548818e0b4bdb8ea2 /rpc/rpc-transport/rdma/src
parent4f65179a8f90547498b00caf48eaad618098ae70 (diff)
rdma: segfault trying to call ibv_dealloc_pd on a null pointer
if ibv_alloc_pd failed If creating an ib protection domain fails, during the cleanup a segfault will occur because trav->pd is null. Bug: 1197260 Change-Id: I21b867c204c4049496b1bf11ec47e4139610266a Signed-off-by: Mark Lipscombe <mlipscombe@gmail.com> Reviewed-on: http://review.gluster.org/9774 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/rdma/src')
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 89a00b736fd..b324fd266db 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -802,7 +802,9 @@ out:
mem_pool_destroy (trav->ioq_pool);
mem_pool_destroy (trav->request_ctx_pool);
mem_pool_destroy (trav->reply_info_pool);
- ibv_dealloc_pd (trav->pd);
+ if (trav->pd != NULL) {
+ ibv_dealloc_pd (trav->pd);
+ }
gf_rdma_destroy_cq (this);
ibv_destroy_comp_channel (trav->recv_chan);
ibv_destroy_comp_channel (trav->send_chan);