diff options
Diffstat (limited to 'net/sched/em_nbyte.c')
-rw-r--r-- | net/sched/em_nbyte.c | 4 |
1 files changed, 1 insertions, 3 deletions
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, | |||
34 | return -EINVAL; | 34 | return -EINVAL; |
35 | 35 | ||
36 | em->datalen = sizeof(*nbyte) + nbyte->len; | 36 | em->datalen = sizeof(*nbyte) + nbyte->len; |
37 | em->data = (unsigned long) kmalloc(em->datalen, GFP_KERNEL); | 37 | em->data = (unsigned long)kmemdup(data, em->datalen, GFP_KERNEL); |
38 | if (em->data == 0UL) | 38 | if (em->data == 0UL) |
39 | return -ENOBUFS; | 39 | return -ENOBUFS; |
40 | 40 | ||
41 | memcpy((void *) em->data, data, em->datalen); | ||
42 | |||
43 | return 0; | 41 | return 0; |
44 | } | 42 | } |
45 | 43 | ||