aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-29 05:11:39 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-01 18:11:37 -0400
commit1b34ec43c9b3de44a5420841ab293d1b2035a94c (patch)
tree8d6cf966c813e0e61001655179b5ef8e5f1b54b3 /net/sched/sch_htb.c
parent9360ffd1859720f6520cf59241909b74dae369d0 (diff)
pkt_sched: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error prone and make code hard to audit. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r--net/sched/sch_htb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 29b942ce9e82..2ea6f196e3c8 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1051,7 +1051,8 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
1051 nest = nla_nest_start(skb, TCA_OPTIONS); 1051 nest = nla_nest_start(skb, TCA_OPTIONS);
1052 if (nest == NULL) 1052 if (nest == NULL)
1053 goto nla_put_failure; 1053 goto nla_put_failure;
1054 NLA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt); 1054 if (nla_put(skb, TCA_HTB_INIT, sizeof(gopt), &gopt))
1055 goto nla_put_failure;
1055 nla_nest_end(skb, nest); 1056 nla_nest_end(skb, nest);
1056 1057
1057 spin_unlock_bh(root_lock); 1058 spin_unlock_bh(root_lock);
@@ -1090,7 +1091,8 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
1090 opt.quantum = cl->quantum; 1091 opt.quantum = cl->quantum;
1091 opt.prio = cl->prio; 1092 opt.prio = cl->prio;
1092 opt.level = cl->level; 1093 opt.level = cl->level;
1093 NLA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt); 1094 if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))
1095 goto nla_put_failure;
1094 1096
1095 nla_nest_end(skb, nest); 1097 nla_nest_end(skb, nest);
1096 spin_unlock_bh(root_lock); 1098 spin_unlock_bh(root_lock);