From ed16f3e9f0e86fb74fb3f1a2c695085af2185368 Mon Sep 17 00:00:00 2001 From: WANG Cong Date: Mon, 15 Sep 2014 14:06:46 -0700 Subject: [PATCH] net_sched: fix an allocation bug in tcindex_set_parms() Fixes: commit 44311af2aed43cc3ab4 ("net: sched: RCU cls_tcindex") Cc: John Fastabend Signed-off-by: Cong Wang Signed-off-by: David S. Miller --- net/sched/cls_tcindex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index a9f4279fbd698..a02ca7298385f 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; -- 2.39.5