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>
This commit is contained in:
David S. Miller 2012-03-29 05:11:39 -04:00
parent 9360ffd185
commit 1b34ec43c9
40 changed files with 263 additions and 157 deletions

View file

@ -1051,7 +1051,8 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
nest = nla_nest_start(skb, TCA_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
NLA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt);
if (nla_put(skb, TCA_HTB_INIT, sizeof(gopt), &gopt))
goto nla_put_failure;
nla_nest_end(skb, nest);
spin_unlock_bh(root_lock);
@ -1090,7 +1091,8 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
opt.quantum = cl->quantum;
opt.prio = cl->prio;
opt.level = cl->level;
NLA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt);
if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))
goto nla_put_failure;
nla_nest_end(skb, nest);
spin_unlock_bh(root_lock);