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
This commit is contained in:
Bart Van Assche
2014-04-18 12:08:00 +00:00
parent 4377509628
commit ffb6115cb9

View File

@@ -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);