diff options
Diffstat (limited to 'net/sched/act_simple.c')
-rw-r--r-- | net/sched/act_simple.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 901571a67707..5fe80854ca91 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
@@ -71,11 +71,10 @@ static int tcf_simp_release(struct tcf_defact *d, int bind) | |||
71 | 71 | ||
72 | static int alloc_defdata(struct tcf_defact *d, u32 datalen, void *defdata) | 72 | static int alloc_defdata(struct tcf_defact *d, u32 datalen, void *defdata) |
73 | { | 73 | { |
74 | d->tcfd_defdata = kmalloc(datalen, GFP_KERNEL); | 74 | d->tcfd_defdata = kmemdup(defdata, datalen, GFP_KERNEL); |
75 | if (unlikely(!d->tcfd_defdata)) | 75 | if (unlikely(!d->tcfd_defdata)) |
76 | return -ENOMEM; | 76 | return -ENOMEM; |
77 | d->tcfd_datalen = datalen; | 77 | d->tcfd_datalen = datalen; |
78 | memcpy(d->tcfd_defdata, defdata, datalen); | ||
79 | return 0; | 78 | return 0; |
80 | } | 79 | } |
81 | 80 | ||