From ffb6115cb9ae837060b854f7cc144664d74f7864 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 18 Apr 2014 12:08:00 +0000 Subject: [PATCH] ib_srpt: Remove a superfluous check from the REQ handler ib_send_cm_rep() checks the connection state before sending a response. Hence checking ch->state before calling ib_send_cm_rep() is superfluous, so remove that check and also the locking that is no longer needed. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5441 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index a23324745..a83ee58a6 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2654,17 +2654,12 @@ restart: rep_param->responder_resources = 4; rep_param->initiator_depth = 4; - spin_lock_irq(&srpt_tgt->spinlock); - if (ch->state == CH_CONNECTING) - ret = ib_send_cm_rep(cm_id, rep_param); - else - ret = -ECONNABORTED; - spin_unlock_irq(&srpt_tgt->spinlock); + ret = ib_send_cm_rep(cm_id, rep_param); switch (ret) { case 0: break; - case -ECONNABORTED: + case -EINVAL: goto reject; default: rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);