[SCHED]: Use kmemdup & kzalloc where appropriate

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo
2006-11-21 01:19:40 -02:00
committed by David S. Miller
parent b3ab09f9e1
commit c7b1b24978
6 changed files with 7 additions and 15 deletions

View File

@@ -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;
}