From 33214ef83684c3b025c773931c071f8af030242b Mon Sep 17 00:00:00 2001 From: Mark Lipscombe Date: Fri, 27 Feb 2015 15:36:48 -0800 Subject: 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 Reviewed-on: http://review.gluster.org/9774 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- rpc/rpc-transport/rdma/src/rdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rpc/rpc-transport/rdma') 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); -- cgit