summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_tbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r--net/sched/sch_tbf.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index a2f93c0..e22dfe8 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -236,7 +236,6 @@ static int tbf_change(struct Qdisc* sch, struct nlattr *opt)
struct tc_tbf_qopt *qopt;
struct qdisc_rate_table *rtab = NULL;
struct qdisc_rate_table *ptab = NULL;
- struct qdisc_rate_table *tmp;
struct Qdisc *child = NULL;
int max_size,n;
@@ -295,13 +294,9 @@ static int tbf_change(struct Qdisc* sch, struct nlattr *opt)
q->tokens = q->buffer;
q->ptokens = q->mtu;
- tmp = q->R_tab;
- q->R_tab = rtab;
- rtab = tmp;
+ swap(q->R_tab, rtab);
+ swap(q->P_tab, ptab);
- tmp = q->P_tab;
- q->P_tab = ptab;
- ptab = tmp;
sch_tree_unlock(sch);
err = 0;
done:
OpenPOWER on IntegriCloud