]> err.no Git - linux-2.6/blobdiff - net/sched/em_meta.c
Merge branch 'intelfb-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[linux-2.6] / net / sched / em_meta.c
index cf68a59fdc5a4d4d6ac2bfbd5b63f99cd4574cee..61e3b740ab1a9b434cfc0a79955a5880e134826f 100644 (file)
@@ -58,7 +58,6 @@
  *           only available if that subsytem is enabled in the kernel.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -561,8 +560,7 @@ static int meta_var_change(struct meta_value *dst, struct rtattr *rta)
 
 static void meta_var_destroy(struct meta_value *v)
 {
-       if (v->val)
-               kfree((void *) v->val);
+       kfree((void *) v->val);
 }
 
 static void meta_var_apply_extras(struct meta_value *v,
@@ -775,10 +773,9 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
            TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX)
                goto errout;
 
-       meta = kmalloc(sizeof(*meta), GFP_KERNEL);
+       meta = kzalloc(sizeof(*meta), GFP_KERNEL);
        if (meta == NULL)
                goto errout;
-       memset(meta, 0, sizeof(*meta));
 
        memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
        memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));