summaryrefslogtreecommitdiff
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_pedit.c')
-rw-r--r--net/sched/act_pedit.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index c819b812a899..b562fc2bb5b1 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -245,14 +245,12 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
nparms->tcfp_flags = parm->flags;
nparms->tcfp_nkeys = parm->nkeys;
- nparms->tcfp_keys = kmalloc(ksize, GFP_KERNEL);
+ nparms->tcfp_keys = kmemdup(parm->keys, ksize, GFP_KERNEL);
if (!nparms->tcfp_keys) {
ret = -ENOMEM;
goto put_chain;
}
- memcpy(nparms->tcfp_keys, parm->keys, ksize);
-
for (i = 0; i < nparms->tcfp_nkeys; ++i) {
u32 offmask = nparms->tcfp_keys[i].offmask;
u32 cur = nparms->tcfp_keys[i].off;