[SCHED]: Use kmemdup & kzalloc where appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
b3ab09f9e1
commit
c7b1b24978
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user