From d63007e5caaf4af65e76c7e91ad2a88f1bc30d10 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 27 Jun 2016 14:14:02 -0700 Subject: [PATCH] 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: Daniel Verkamp --- lib/nvmf/rdma.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 21b9e7e8fc..3326f333df 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -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; } - } else if (ret > 0) { - /* - * Pending transfer from host to controller; command will continue - * once transfer is complete. - */ - ret = 0; + + return 0; } - if (ret < 0) { - /* recover the tx_desc */ - nvmf_deactive_tx_desc(tx_desc); - } - - return ret; + /* + * Pending transfer from host to controller; command will continue + * once transfer is complete. + */ + return 0; } int