From c7b1b24978d89efab7d420bbdc9557dbe6259c89 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo <acme@mandriva.com> Date: Tue, 21 Nov 2006 01:19:40 -0200 Subject: [SCHED]: Use kmemdup & kzalloc where appropriate Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> --- net/sched/em_nbyte.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/sched/em_nbyte.c') diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c index cc80babfd79f..005db409be64 100644 --- a/net/sched/em_nbyte.c +++ b/net/sched/em_nbyte.c @@ -34,12 +34,10 @@ static int em_nbyte_change(struct tcf_proto *tp, void *data, int data_len, return -EINVAL; em->datalen = sizeof(*nbyte) + nbyte->len; - em->data = (unsigned long) kmalloc(em->datalen, GFP_KERNEL); + em->data = (unsigned long)kmemdup(data, em->datalen, GFP_KERNEL); if (em->data == 0UL) return -ENOBUFS; - memcpy((void *) em->data, data, em->datalen); - return 0; } -- cgit v1.2.3-58-ga151