ib_srpt: Fix a race triggered by the code for handling IB CM RTU notifications

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4192 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2012-04-06 08:00:14 +00:00
parent f4699ee2d0
commit 4c36a0632a

View File

@@ -2642,16 +2642,7 @@ static void srpt_cm_rtu_recv(struct ib_cm_id *cm_id)
BUG_ON(!ch);
if (srpt_test_and_set_ch_state(ch, CH_CONNECTING, CH_LIVE)) {
struct srpt_recv_ioctx *ioctx, *ioctx_tmp;
ret = srpt_ch_qp_rts(ch, ch->qp);
list_for_each_entry_safe(ioctx, ioctx_tmp, &ch->cmd_wait_list,
wait_list) {
list_del(&ioctx->wait_list);
srpt_handle_new_iu(ch, ioctx, NULL,
SCST_CONTEXT_THREAD);
}
if (ret)
srpt_close_ch(ch);
}