lib: validate ib_verbs context is valid before using it
Change-Id: I54793624e46a4e51b0c989ddfe933ccb5f035123 Signed-off-by: shahar salzman <shahar.salzman@kaminario.com> Reviewed-on: https://review.gerrithub.io/417858 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
6d05186697
commit
a0246f6553
@ -1487,6 +1487,14 @@ spdk_nvmf_rdma_listen(struct spdk_nvmf_transport *transport,
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (!port->id->verbs) {
|
||||
SPDK_ERRLOG("ibv_context is null\n");
|
||||
rdma_destroy_id(port->id);
|
||||
free(port);
|
||||
pthread_mutex_unlock(&rtransport->lock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = rdma_listen(port->id, 10); /* 10 = backlog */
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("rdma_listen() failed\n");
|
||||
|
Loading…
Reference in New Issue
Block a user