From: zhengbin Date: Tue, 13 Aug 2019 14:05:50 +0000 (+0800) Subject: sctp: fix memleak in sctp_send_reset_streams X-Git-Tag: v4.19.68~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=227f204ad1974866bb79b29a94e8b9ee9491793a;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: zhengbin Acked-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 0da5793..87061a4 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -416,6 +416,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; }