aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence/macb.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2012-07-02 09:59:24 +0000
committerDavid S. Miller <davem@davemloft.net>2012-07-08 23:56:16 -0700
commited1062772531b6e1029fa4ca62dc8d61f6d53d1c (patch)
tree2b1854d347f77cfd71a145b3976ebecc1dabf02c /drivers/net/ethernet/cadence/macb.c
parentbnx2i: use strlcpy() instead of memcpy() for strings (diff)
downloadlinux-dev-ed1062772531b6e1029fa4ca62dc8d61f6d53d1c.tar.xz
linux-dev-ed1062772531b6e1029fa4ca62dc8d61f6d53d1c.zip
sctp: refactor sctp_packet_append_chunk and clenup some memory leaks
While doing some recent work on sctp sack bundling I noted that sctp_packet_append_chunk was pretty inefficient. Specifially, it was called recursively while trying to bundle auth and sack chunks. Because of that we call sctp_packet_bundle_sack and sctp_packet_bundle_auth a total of 4 times for every call to sctp_packet_append_chunk, knowing that at least 3 of those calls will do nothing. So lets refactor sctp_packet_bundle_auth to have an outer part that does the attempted bundling, and an inner part that just does the chunk appends. This saves us several calls per iteration that we just don't need. Also, noticed that the auth and sack bundling fail to free the chunks they allocate if the append fails, so make sure we add that in Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yasevich <vyasevich@gmail.com> CC: "David S. Miller" <davem@davemloft.net> CC: linux-sctp@vger.kernel.org Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions