nvme_rdma: in qp_disconnect, set resources to NULL

This prevents us from failing a reset and then trying to double put the
rqpair->cq which ends up causing seg faults.

Change-Id: If3e14a3d039b4b19cc587a7482157f4b23f8ee32
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469609
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Seth Howell 2019-09-26 08:19:18 -07:00 committed by Jim Harris
parent 06746448c1
commit f12e6bc041

View File

@ -1402,14 +1402,17 @@ nvme_rdma_qpair_disconnect(struct spdk_nvme_qpair *qpair)
rdma_destroy_qp(rqpair->cm_id); rdma_destroy_qp(rqpair->cm_id);
} }
rdma_destroy_id(rqpair->cm_id); rdma_destroy_id(rqpair->cm_id);
rqpair->cm_id = NULL;
} }
if (rqpair->cq) { if (rqpair->cq) {
ibv_destroy_cq(rqpair->cq); ibv_destroy_cq(rqpair->cq);
rqpair->cq = NULL;
} }
if (rqpair->cm_channel) { if (rqpair->cm_channel) {
rdma_destroy_event_channel(rqpair->cm_channel); rdma_destroy_event_channel(rqpair->cm_channel);
rqpair->cm_channel = NULL;
} }
} }