hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/sctp/diag.c
....@@ -349,11 +349,9 @@
349349 struct sctp_comm_param *commp = p;
350350 struct sock *sk = ep->base.sk;
351351 const struct inet_diag_req_v2 *r = commp->r;
352
- struct sctp_association *assoc =
353
- list_entry(ep->asocs.next, struct sctp_association, asocs);
354352
355353 /* find the ep only once through the transports by this condition */
356
- if (tsp->asoc != assoc)
354
+ if (!list_is_first(&tsp->asoc->asocs, &ep->asocs))
357355 return 0;
358356
359357 if (r->sdiag_family != AF_UNSPEC && sk->sk_family != r->sdiag_family)