Skip to content

Commit

Permalink
[PKT_SCHED]: Correctly handle empty ematch trees
Browse files Browse the repository at this point in the history
Fixes an invalid memory reference when the basic classifier
is used without any ematches but just actions.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Nov 8, 2005
1 parent 18a0c23 commit b541ca2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/sched/ematch.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta,
struct tcf_ematch_tree_hdr *tree_hdr;
struct tcf_ematch *em;

if (!rta) {
memset(tree, 0, sizeof(*tree));
return 0;
}

if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0)
goto errout;

Expand Down

0 comments on commit b541ca2

Please sign in to comment.