Commit d63007e5 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvmf: clean up nvmf_recv() error path



If spdk_nvmf_request_exec() fails, the connection will be closed anyway,
so just leave the tx_desc in the active array; it will be cleaned up in
the normal connection cleanup path.

Change-Id: Ie4f60bd6001658403dd7e1c6a47d40be756ef6f2
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 3d9ef1a9
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -1176,21 +1176,17 @@ nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
		ret = spdk_nvmf_request_exec(req);
		if (ret < 0) {
			SPDK_ERRLOG("Command execution failed\n");
			return -1;
		}

		return 0;
	}
	} else if (ret > 0) {

	/*
	 * Pending transfer from host to controller; command will continue
	 * once transfer is complete.
	 */
		ret = 0;
	}

	if (ret < 0) {
		/* recover the tx_desc */
		nvmf_deactive_tx_desc(tx_desc);
	}

	return ret;
	return 0;
}

int