summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorzhengbin <zhengbin13@huawei.com>2019-08-13 22:05:50 +0800
committerSasha Levin <sashal@kernel.org>2019-08-25 10:10:36 -0400
commit07a1e1551689701ac7d229ade34e1727012d4637 (patch)
tree8f703de013c3be65b1b37048861c5c34e1b3bad7 /net
parentaa21b3e2fdb375b4e7a2a81c440c4fb519b430a5 (diff)
downloadlinux-stable-07a1e1551689701ac7d229ade34e1727012d4637.tar.gz
linux-stable-07a1e1551689701ac7d229ade34e1727012d4637.tar.bz2
linux-stable-07a1e1551689701ac7d229ade34e1727012d4637.zip
sctp: fix memleak in sctp_send_reset_streams
[ Upstream commit 6d5afe20397b478192ed8c38ec0ee10fa3aec649 ] If the stream outq is not empty, need to kfree nstr_list. Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream outq is empty") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/stream.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/stream.c b/net/sctp/stream.c
index 25946604af85..e83cdaa2ab76 100644
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -316,6 +316,7 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
nstr_list[i] = htons(str_list[i]);
if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
+ kfree(nstr_list);
retval = -EAGAIN;
goto out;
}