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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user