X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsched%2Fematch.c;h=e82519e548d70c747f602bc179ca487f120ef5af;hb=63b40456a30912084c90753582137b9e0495c5c3;hp=74ff918455a2acc2885f5fce5e9da30db3d527fa;hpb=7a9c1bd409d3522806d492aa573c1cc5384ca620;p=pandora-kernel.git diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 74ff918455a2..e82519e548d7 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -224,7 +224,7 @@ static int tcf_em_validate(struct tcf_proto *tp, if (em->ops == NULL) { err = -ENOENT; -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES __rtnl_unlock(); request_module("ematch-kind-%u", em_hdr->kind); rtnl_lock(); @@ -312,10 +312,9 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla, struct tcf_ematch_tree_hdr *tree_hdr; struct tcf_ematch *em; - if (!nla) { - memset(tree, 0, sizeof(*tree)); + memset(tree, 0, sizeof(*tree)); + if (!nla) return 0; - } err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy); if (err < 0) @@ -410,7 +409,7 @@ void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree) if (em->ops) { if (em->ops->destroy) em->ops->destroy(tp, em); - else if (!tcf_em_is_simple(em) && em->data) + else if (!tcf_em_is_simple(em)) kfree((void *) em->data); module_put(em->ops->owner); } @@ -418,6 +417,7 @@ void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree) tree->hdr.nmatches = 0; kfree(tree->matches); + tree->matches = NULL; } EXPORT_SYMBOL(tcf_em_tree_destroy);