diff options
Diffstat (limited to 'net/sched/em_meta.c')
-rw-r--r-- | net/sched/em_meta.c | 3 |
1 files changed, 1 insertions, 2 deletions
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) | |||
546 | { | 546 | { |
547 | int len = RTA_PAYLOAD(rta); | 547 | int len = RTA_PAYLOAD(rta); |
548 | 548 | ||
549 | dst->val = (unsigned long) kmalloc(len, GFP_KERNEL); | 549 | dst->val = (unsigned long)kmemdup(RTA_DATA(rta), len, GFP_KERNEL); |
550 | if (dst->val == 0UL) | 550 | if (dst->val == 0UL) |
551 | return -ENOMEM; | 551 | return -ENOMEM; |
552 | memcpy((void *) dst->val, RTA_DATA(rta), len); | ||
553 | dst->len = len; | 552 | dst->len = len; |
554 | return 0; | 553 | return 0; |
555 | } | 554 | } |