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