summaryrefslogtreecommitdiff
path: root/net/sctp/stream_sched_rr.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2022-11-30 18:04:31 -0500
committerJakub Kicinski <kuba@kernel.org>2022-12-01 20:14:23 -0800
commit7d802c8098c50fb7dcf5dfcb6466482e1f2b15e4 (patch)
tree20ea8941ed159b09bd7fa230efe237f0d43f4434 /net/sctp/stream_sched_rr.c
parente6a34faf31fb7adb9b88f11186028affdf522cd5 (diff)
sctp: delete free member from struct sctp_sched_ops
After commit 9ed7bfc79542 ("sctp: fix memory leak in sctp_stream_outq_migrate()"), sctp_sched_set_sched() is the only place calling sched->free(), and it can actually be replaced by sched->free_sid() on each stream, and yet there's already a loop to traverse all streams in sctp_sched_set_sched(). This patch adds a function sctp_sched_free_sched() where it calls sched->free_sid() for each stream to replace sched->free() calls in sctp_sched_set_sched() and then deletes the unused free member from struct sctp_sched_ops. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Link: https://lore.kernel.org/r/e10aac150aca2686cb0bd0570299ec716da5a5c0.1669849471.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sctp/stream_sched_rr.c')
-rw-r--r--net/sctp/stream_sched_rr.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/sctp/stream_sched_rr.c b/net/sctp/stream_sched_rr.c
index cc444fe0d67c..1f235e7f643a 100644
--- a/net/sctp/stream_sched_rr.c
+++ b/net/sctp/stream_sched_rr.c
@@ -94,11 +94,6 @@ static void sctp_sched_rr_free_sid(struct sctp_stream *stream, __u16 sid)
{
}
-static void sctp_sched_rr_free(struct sctp_stream *stream)
-{
- sctp_sched_rr_unsched_all(stream);
-}
-
static void sctp_sched_rr_enqueue(struct sctp_outq *q,
struct sctp_datamsg *msg)
{
@@ -182,7 +177,6 @@ static struct sctp_sched_ops sctp_sched_rr = {
.init = sctp_sched_rr_init,
.init_sid = sctp_sched_rr_init_sid,
.free_sid = sctp_sched_rr_free_sid,
- .free = sctp_sched_rr_free,
.enqueue = sctp_sched_rr_enqueue,
.dequeue = sctp_sched_rr_dequeue,
.dequeue_done = sctp_sched_rr_dequeue_done,