[SCHED]: Use kmemdup & kzalloc where appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 0fd0768..8f8a16d 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -251,12 +251,11 @@
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;
}
}