hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/sw/siw/siw_cm.c
....@@ -973,6 +973,7 @@
973973 siw_cep_put(cep);
974974 new_cep->listen_cep = NULL;
975975 if (rv) {
976
+ siw_cancel_mpatimer(new_cep);
976977 siw_cep_set_free(new_cep);
977978 goto error;
978979 }
....@@ -1097,9 +1098,12 @@
10971098 /*
10981099 * Socket close before MPA request received.
10991100 */
1100
- siw_dbg_cep(cep, "no mpareq: drop listener\n");
1101
- siw_cep_put(cep->listen_cep);
1102
- cep->listen_cep = NULL;
1101
+ if (cep->listen_cep) {
1102
+ siw_dbg_cep(cep,
1103
+ "no mpareq: drop listener\n");
1104
+ siw_cep_put(cep->listen_cep);
1105
+ cep->listen_cep = NULL;
1106
+ }
11031107 }
11041108 }
11051109 release_cep = 1;
....@@ -1222,7 +1226,11 @@
12221226 if (!cep)
12231227 goto out;
12241228
1225
- siw_dbg_cep(cep, "state: %d\n", cep->state);
1229
+ siw_dbg_cep(cep, "cep state: %d, socket state %d\n",
1230
+ cep->state, sk->sk_state);
1231
+
1232
+ if (sk->sk_state != TCP_ESTABLISHED)
1233
+ goto out;
12261234
12271235 switch (cep->state) {
12281236 case SIW_EPSTATE_RDMA_MODE:
....@@ -1490,7 +1498,6 @@
14901498
14911499 cep->cm_id = NULL;
14921500 id->rem_ref(id);
1493
- siw_cep_put(cep);
14941501
14951502 qp->cep = NULL;
14961503 siw_cep_put(cep);