aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r--net/sctp/bind_addr.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index f54333cbbe0f..53bc61537f44 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -393,24 +393,19 @@ int sctp_bind_addr_state(const struct sctp_bind_addr *bp,
393{ 393{
394 struct sctp_sockaddr_entry *laddr; 394 struct sctp_sockaddr_entry *laddr;
395 struct sctp_af *af; 395 struct sctp_af *af;
396 int state = -1;
397 396
398 af = sctp_get_af_specific(addr->sa.sa_family); 397 af = sctp_get_af_specific(addr->sa.sa_family);
399 if (unlikely(!af)) 398 if (unlikely(!af))
400 return state; 399 return -1;
401 400
402 rcu_read_lock();
403 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 401 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
404 if (!laddr->valid) 402 if (!laddr->valid)
405 continue; 403 continue;
406 if (af->cmp_addr(&laddr->a, addr)) { 404 if (af->cmp_addr(&laddr->a, addr))
407 state = laddr->state; 405 return laddr->state;
408 break;
409 }
410 } 406 }
411 rcu_read_unlock();
412 407
413 return state; 408 return -1;
414} 409}
415 410
416/* Find the first address in the bind address list that is not present in 411/* Find the first address in the bind address list that is not present in