diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-11-08 12:39:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-08 12:39:17 -0500 |
commit | b541ca2c5a3f3f399d6f2ec9da33c1be5a8d8c19 (patch) | |
tree | 4e3596af9d6020820b751829b98fa80029b80499 | |
parent | 18a0c23617a2cb1c2e55e650046c2084d823fde0 (diff) |
[PKT_SCHED]: Correctly handle empty ematch trees
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>
-rw-r--r-- | net/sched/ematch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index ebfe2e7d21bd..64b047c65568 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -298,6 +298,11 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, | |||
298 | struct tcf_ematch_tree_hdr *tree_hdr; | 298 | struct tcf_ematch_tree_hdr *tree_hdr; |
299 | struct tcf_ematch *em; | 299 | struct tcf_ematch *em; |
300 | 300 | ||
301 | if (!rta) { | ||
302 | memset(tree, 0, sizeof(*tree)); | ||
303 | return 0; | ||
304 | } | ||
305 | |||
301 | if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) | 306 | if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) |
302 | goto errout; | 307 | goto errout; |
303 | 308 | ||