Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
[linux-drm-fsl-dcu.git] / net / sched / ematch.c
index 2405a86093a2eeed7d7ebbed7ce92b5d4527a062..0fd0768a17c6cc9ab5b627bbfd94bee9c03b9657 100644 (file)
@@ -321,10 +321,9 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta,
        list_len = RTA_PAYLOAD(rt_list);
        matches_len = tree_hdr->nmatches * sizeof(*em);
 
-       tree->matches = kmalloc(matches_len, GFP_KERNEL);
+       tree->matches = kzalloc(matches_len, GFP_KERNEL);
        if (tree->matches == NULL)
                goto errout;
-       memset(tree->matches, 0, matches_len);
 
        /* We do not use rtattr_parse_nested here because the maximum
         * number of attributes is unknown. This saves us the allocation