diff options
author | David S. Miller <davem@davemloft.net> | 2012-03-29 05:11:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-01 18:11:37 -0400 |
commit | 1b34ec43c9b3de44a5420841ab293d1b2035a94c (patch) | |
tree | 8d6cf966c813e0e61001655179b5ef8e5f1b54b3 /net/sched/ematch.c | |
parent | 9360ffd1859720f6520cf59241909b74dae369d0 (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/ematch.c')
-rw-r--r-- | net/sched/ematch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 88d93eb92507..aca233c2b848 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -441,7 +441,8 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) | |||
441 | if (top_start == NULL) | 441 | if (top_start == NULL) |
442 | goto nla_put_failure; | 442 | goto nla_put_failure; |
443 | 443 | ||
444 | NLA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); | 444 | if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr)) |
445 | goto nla_put_failure; | ||
445 | 446 | ||
446 | list_start = nla_nest_start(skb, TCA_EMATCH_TREE_LIST); | 447 | list_start = nla_nest_start(skb, TCA_EMATCH_TREE_LIST); |
447 | if (list_start == NULL) | 448 | if (list_start == NULL) |
@@ -457,7 +458,8 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) | |||
457 | .flags = em->flags | 458 | .flags = em->flags |
458 | }; | 459 | }; |
459 | 460 | ||
460 | NLA_PUT(skb, i + 1, sizeof(em_hdr), &em_hdr); | 461 | if (nla_put(skb, i + 1, sizeof(em_hdr), &em_hdr)) |
462 | goto nla_put_failure; | ||
461 | 463 | ||
462 | if (em->ops && em->ops->dump) { | 464 | if (em->ops && em->ops->dump) { |
463 | if (em->ops->dump(skb, em) < 0) | 465 | if (em->ops->dump(skb, em) < 0) |