summaryrefslogtreecommitdiffstats
path: root/net/sched/cls_tcindex.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-09-15 23:06:46 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-15 23:48:23 +0200
commita57a65ba47b71e7af67af30466c7e0bd2ec5786d (patch)
treedede472aa465a94419df0f4623d1dc5fd392424c /net/sched/cls_tcindex.c
parentnet_sched: fix suspicious RCU usage in cls_bpf_classify() (diff)
downloadlinux-a57a65ba47b71e7af67af30466c7e0bd2ec5786d.tar.xz
linux-a57a65ba47b71e7af67af30466c7e0bd2ec5786d.zip
net_sched: fix an allocation bug in tcindex_set_parms()
Fixes: commit 331b72922c5f58d48fd ("net: sched: RCU cls_tcindex") Cc: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_tcindex.c')
-rw-r--r--net/sched/cls_tcindex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index a9f4279fbd69..a02ca7298385 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -241,7 +241,7 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
* allocate new tcindex data and RCU assign it onto root. Keeping
* perfect hash and hash pointers from old data.
*/
- cp = kzalloc(sizeof(cp), GFP_KERNEL);
+ cp = kzalloc(sizeof(*cp), GFP_KERNEL);
if (!cp)
return -ENOMEM;