]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
sctp: shrink stream outq only when new outcnt < old outcnt
authorXin Long <lucien.xin@gmail.com>
Wed, 22 Jul 2020 15:52:11 +0000 (23:52 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit5697d7e5136384242a8b624d12230a5c5d99a847
tree34e6bab57bbb4be33a279f29793d81289e4323a6
parentc040f0ba6652a27526334d2f26f7911dfa2b09dd
sctp: shrink stream outq only when new outcnt < old outcnt

BugLink: https://bugs.launchpad.net/bugs/1890343
[ Upstream commit 8f13399db22f909a35735bf8ae2f932e0c8f0e30 ]

It's not necessary to go list_for_each for outq->out_chunk_list
when new outcnt >= old outcnt, as no chunk with higher sid than
new (outcnt - 1) exists in the outqueue.

While at it, also move the list_for_each code in a new function
sctp_stream_shrink_out(), which will be used in the next patch.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/sctp/stream.c