summaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_sideeffect.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevich@gmail.com>2015-08-29 03:23:39 +0200
committerDavid S. Miller <davem@davemloft.net>2015-08-29 07:25:43 +0200
commit73e6742027f5cb5a7c747d9abab5351b01fd4c74 (patch)
tree5fc03ff07997ea5883a9279ce5d2b77d9407328c /net/sctp/sm_sideeffect.c
parentbonding: fix bond_poll_controller bh_enable warning (diff)
downloadlinux-73e6742027f5cb5a7c747d9abab5351b01fd4c74.tar.xz
linux-73e6742027f5cb5a7c747d9abab5351b01fd4c74.zip
sctp: Do not try to search for the transport twice
When removing an non-primary transport during ASCONF processing, we end up traversing the transport list twice: once in sctp_cmd_del_non_primary, and once in sctp_assoc_del_peer. We can avoid the second search and call sctp_assoc_rm_peer() instead. Found by code inspection during code reviews. Signed-off-by: Vladislav Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_sideeffect.c')
-rw-r--r--net/sctp/sm_sideeffect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 85e6f03aeb70..35df1266bf07 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -954,7 +954,7 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
t = list_entry(pos, struct sctp_transport, transports);
if (!sctp_cmp_addr_exact(&t->ipaddr,
&asoc->peer.primary_addr)) {
- sctp_assoc_del_peer(asoc, &t->ipaddr);
+ sctp_assoc_rm_peer(asoc, t);
}
}
}