diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2012-07-02 09:59:24 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-09 06:56:16 (GMT) |
commit | ed1062772531b6e1029fa4ca62dc8d61f6d53d1c (patch) | |
tree | 2b1854d347f77cfd71a145b3976ebecc1dabf02c /drivers/isdn/gigaset/gigaset.h | |
parent | 12aba9e7974c5aabf0f4b8e90a5943bfa17fadf4 (diff) | |
download | linux-fsl-qoriq-ed1062772531b6e1029fa4ca62dc8d61f6d53d1c.tar.xz |
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 'drivers/isdn/gigaset/gigaset.h')
0 files changed, 0 insertions, 0 deletions