diff options
Diffstat (limited to 'net/sched/ematch.c')
-rw-r--r-- | net/sched/ematch.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index d2b480f01a40..daa9c4e7e81d 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -436,14 +436,18 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) | |||
436 | { | 436 | { |
437 | int i; | 437 | int i; |
438 | u8 *tail; | 438 | u8 *tail; |
439 | struct nlattr *top_start = (struct nlattr *)skb_tail_pointer(skb); | 439 | struct nlattr *top_start; |
440 | struct nlattr *list_start; | 440 | struct nlattr *list_start; |
441 | 441 | ||
442 | NLA_PUT(skb, tlv, 0, NULL); | 442 | top_start = nla_nest_start(skb, tlv); |
443 | if (top_start == NULL) | ||
444 | goto nla_put_failure; | ||
445 | |||
443 | NLA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); | 446 | NLA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); |
444 | 447 | ||
445 | list_start = (struct nlattr *)skb_tail_pointer(skb); | 448 | list_start = nla_nest_start(skb, TCA_EMATCH_TREE_LIST); |
446 | NLA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); | 449 | if (list_start == NULL) |
450 | goto nla_put_failure; | ||
447 | 451 | ||
448 | tail = skb_tail_pointer(skb); | 452 | tail = skb_tail_pointer(skb); |
449 | for (i = 0; i < tree->hdr.nmatches; i++) { | 453 | for (i = 0; i < tree->hdr.nmatches; i++) { |
@@ -470,8 +474,8 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) | |||
470 | match_start->nla_len = tail - (u8 *)match_start; | 474 | match_start->nla_len = tail - (u8 *)match_start; |
471 | } | 475 | } |
472 | 476 | ||
473 | list_start->nla_len = tail - (u8 *)list_start; | 477 | nla_nest_end(skb, list_start); |
474 | top_start->nla_len = tail - (u8 *)top_start; | 478 | nla_nest_end(skb, top_start); |
475 | 479 | ||
476 | return 0; | 480 | return 0; |
477 | 481 | ||