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

@@ -346,14 +346,17 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
if (nest == NULL)
goto nla_put_failure;
if (f->res.classid)
NLA_PUT_U32(skb, TCA_FW_CLASSID, f->res.classid);
if (f->res.classid &&
nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid))
goto nla_put_failure;
#ifdef CONFIG_NET_CLS_IND
if (strlen(f->indev))
NLA_PUT_STRING(skb, TCA_FW_INDEV, f->indev);
if (strlen(f->indev) &&
nla_put_string(skb, TCA_FW_INDEV, f->indev))
goto nla_put_failure;
#endif /* CONFIG_NET_CLS_IND */
if (head->mask != 0xFFFFFFFF)
NLA_PUT_U32(skb, TCA_FW_MASK, head->mask);
if (head->mask != 0xFFFFFFFF &&
nla_put_u32(skb, TCA_FW_MASK, head->mask))
goto nla_put_failure;
if (tcf_exts_dump(skb, &f->exts, &fw_ext_map) < 0)
goto nla_put_failure;