kernel/net/sctp/diag.c
.. .. @@ -349,11 +349,9 @@ 349 349 struct sctp_comm_param *commp = p; 350 350 struct sock *sk = ep->base.sk; 351 351 const struct inet_diag_req_v2 *r = commp->r; 352 - struct sctp_association *assoc =353 - list_entry(ep->asocs.next, struct sctp_association, asocs);354 352 355 353 /* 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))357 355 return 0; 358 356 359 357 if (r->sdiag_family != AF_UNSPEC && sk->sk_family != r->sdiag_family)