From 78b69710f3668e38e0eeffd11db455ae2bdf1194 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Thu, 16 Jun 2016 15:34:19 +0800 Subject: [PATCH] nvmf: Make tx_desc free correct in nvmf_recv Should set tx_desc=NULL here. If not,When nvmf_post_rdma_recv(conn, rx_desc) fails, we would make tx_desc deactive again, and this is wrong. Change-Id: Ieabc7e3864b7f124b003d052f66ab8799a1d632e Signed-off-by: Ziye Yang --- lib/nvmf/conn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index ce321d9852..acc972b85c 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -1062,6 +1062,7 @@ static int nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc) if (ret == 1) { tx_desc->rx_desc = NULL; nvmf_deactive_tx_desc(tx_desc); + tx_desc = NULL; if (nvmf_post_rdma_recv(conn, rx_desc)) { SPDK_ERRLOG("Unable to re-post aq rx descriptor\n"); goto recv_error;