From c7b1b24978d89efab7d420bbdc9557dbe6259c89 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 21 Nov 2006 01:19:40 -0200 Subject: [SCHED]: Use kmemdup & kzalloc where appropriate Signed-off-by: Arnaldo Carvalho de Melo --- net/sched/em_meta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'net/sched/em_meta.c') diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index d3ff3503326a..45d47d37155e 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -546,10 +546,9 @@ static int meta_var_change(struct meta_value *dst, struct rtattr *rta) { int len = RTA_PAYLOAD(rta); - dst->val = (unsigned long) kmalloc(len, GFP_KERNEL); + dst->val = (unsigned long)kmemdup(RTA_DATA(rta), len, GFP_KERNEL); if (dst->val == 0UL) return -ENOMEM; - memcpy((void *) dst->val, RTA_DATA(rta), len); dst->len = len; return 0; } -- cgit v1.2.3