Commit b541ca2c authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[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: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18a0c236
...@@ -298,6 +298,11 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, ...@@ -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_tree_hdr *tree_hdr;
struct tcf_ematch *em; struct tcf_ematch *em;
if (!rta) {
memset(tree, 0, sizeof(*tree));
return 0;
}
if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0)
goto errout; goto errout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment