From c927e1dd73cee78be8af424b920ef667e0f386f5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Apr 2013 19:48:06 +0000 Subject: [PATCH] ib_srpt: Fix another bug that was introduced in r4784 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4845 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 21554cbea..e5eea8602 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1462,14 +1462,18 @@ static void srpt_handle_send_err_comp(struct srpt_rdma_ch *ch, u64 wr_id, if (state == SRPT_STATE_CMD_RSP_SENT || state == SRPT_STATE_MGMT_RSP_SENT) srpt_undo_inc_req_lim(ch, ioctx->req_lim_delta); - if (state != SRPT_STATE_DONE) { - if (scmnd) - srpt_abort_cmd(ioctx, context); - else - srpt_put_send_ioctx(ioctx); - } else + switch (state) { + default: + srpt_abort_cmd(ioctx, context); + break; + case SRPT_STATE_MGMT_RSP_SENT: + srpt_put_send_ioctx(ioctx); + break; + case SRPT_STATE_DONE: PRINT_ERROR("Received more than one IB error completion" " for wr_id = %u.", (unsigned)index); + break; + } } /**