From: Hannes Frederic Sowa Date: Sun, 12 Mar 2017 23:01:30 +0000 (+0100) Subject: dccp: fix memory leak during tear-down of unsuccessful connection request X-Git-Tag: v4.9.17~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e38375a4b1748946ab46a317def3046bb425f1e;p=platform%2Fkernel%2Flinux-amlogic.git dccp: fix memory leak during tear-down of unsuccessful connection request [ Upstream commit 72ef9c4125c7b257e3a714d62d778ab46583d6a3 ] This patch fixes a memory leak, which happens if the connection request is not fulfilled between parsing the DCCP options and handling the SYN (because e.g. the backlog is full), because we forgot to free the list of ack vectors. Reported-by: Jianwen Ji Signed-off-by: Hannes Frederic Sowa Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index f053198..5e3a730 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -749,6 +749,7 @@ static void ccid2_hc_tx_exit(struct sock *sk) for (i = 0; i < hc->tx_seqbufc; i++) kfree(hc->tx_seqbuf[i]); hc->tx_seqbufc = 0; + dccp_ackvec_parsed_cleanup(&hc->tx_av_chunks); } static void ccid2_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)