aboutsummaryrefslogtreecommitdiff
path: root/net/sched/sch_tbf.c
diff options
context:
space:
mode:
authorGravatar Jakub Kicinski <kuba@kernel.org> 2022-09-01 12:58:02 -0700
committerGravatar Jakub Kicinski <kuba@kernel.org> 2022-09-01 12:58:02 -0700
commit60ad1100d525699bce83690757ff3077c6ab83ab (patch)
treefd25eb112f4d52f4f5209bb0c83b6c36d25793ae /net/sched/sch_tbf.c
parentnet: sched: gred: remove NULL check before free table->tab in gred_destroy() (diff)
parentMerge tag 'net-6.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff)
downloadlinux-60ad1100d525699bce83690757ff3077c6ab83ab.tar.gz
linux-60ad1100d525699bce83690757ff3077c6ab83ab.tar.bz2
linux-60ad1100d525699bce83690757ff3077c6ab83ab.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
tools/testing/selftests/net/.gitignore sort the net-next version and use it Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r--net/sched/sch_tbf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index d0288e223542..e031c1a41ea6 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -354,6 +354,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
struct nlattr *tb[TCA_TBF_MAX + 1];
struct tc_tbf_qopt *qopt;
struct Qdisc *child = NULL;
+ struct Qdisc *old = NULL;
struct psched_ratecfg rate;
struct psched_ratecfg peak;
u64 max_size;
@@ -445,7 +446,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
sch_tree_lock(sch);
if (child) {
qdisc_tree_flush_backlog(q->qdisc);
- qdisc_put(q->qdisc);
+ old = q->qdisc;
q->qdisc = child;
}
q->limit = qopt->limit;
@@ -465,6 +466,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
memcpy(&q->peak, &peak, sizeof(struct psched_ratecfg));
sch_tree_unlock(sch);
+ qdisc_put(old);
err = 0;
tbf_offload_change(sch);