nvmf: only pass the msg to initialized thread

Change-Id: I73cf34e0184f67a855afe980f5645df25baf4714
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/377652
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
GangCao 2017-09-07 21:29:41 -04:00 committed by Daniel Verkamp
parent 985aaa989c
commit 03305949f9

View File

@ -69,8 +69,9 @@ spdk_nvmf_request_complete(struct spdk_nvmf_request *req)
{
struct spdk_nvme_cmd *cmd = &req->cmd->nvme_cmd;
if (cmd->opc == SPDK_NVME_OPC_FABRIC ||
req->qpair->type == QPAIR_TYPE_AQ) {
if ((cmd->opc == SPDK_NVME_OPC_FABRIC ||
req->qpair->type == QPAIR_TYPE_AQ) &&
req->qpair->thread) {
/* Pass a message back to the originating thread. */
spdk_thread_send_msg(req->qpair->thread,
spdk_nvmf_request_complete_on_qpair,