]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: silence warns on sctp_stream_init allocations
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Tue, 3 Oct 2017 22:20:08 +0000 (19:20 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Oct 2017 23:27:28 +0000 (16:27 -0700)
commit692e2db0d8b16540faff2c91f58968f8b8ed4eca
treed98497191233346cbe9aabbd73829c575f3850f9
parente1edb30c5424c9c335b4049845a49e3392e9c27e
sctp: silence warns on sctp_stream_init allocations

As SCTP supports up to 65535 streams, that can lead to very large
allocations in sctp_stream_init(). As Xin Long noticed, systems with
small amounts of memory are more prone to not have enough memory and
dump warnings on dmesg initiated by user actions. Thus, silence them.

Also, if the reallocation of stream->out is not necessary, skip it and
keep the memory we already have.

Reported-by: Xin Long <lucien.xin@gmail.com>
Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/stream.c