]> Pileus Git - ~andy/linux/blobdiff - net/sched/ematch.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[~andy/linux] / net / sched / ematch.c
index 0fd0768a17c6cc9ab5b627bbfd94bee9c03b9657..8f8a16da72a8970acb1c11357ec228573b85cad4 100644 (file)
@@ -251,12 +251,11 @@ static int tcf_em_validate(struct tcf_proto *tp,
                                        goto errout;
                                em->data = *(u32 *) data;
                        } else {
-                               void *v = kmalloc(data_len, GFP_KERNEL);
+                               void *v = kmemdup(data, data_len, GFP_KERNEL);
                                if (v == NULL) {
                                        err = -ENOBUFS;
                                        goto errout;
                                }
-                               memcpy(v, data, data_len);
                                em->data = (unsigned long) v;
                        }
                }