nvmf/rdma: add event_channel NULL check in fini

If the RDMA transport failed to initialize, g_rdma.event_channel may be
NULL.

Change-Id: I4510ee5893389f244f0fbaa1cd4a182868939b25
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-10-27 09:12:50 -07:00
parent 0d8e28a171
commit 1290f02f78

View File

@ -996,7 +996,9 @@ spdk_nvmf_rdma_fini(void)
rdma_destroy_id(addr->id);
}
rdma_destroy_event_channel(g_rdma.event_channel);
if (g_rdma.event_channel != NULL) {
rdma_destroy_event_channel(g_rdma.event_channel);
}
pthread_mutex_unlock(&g_rdma.lock);
return 0;