net_sched: fix an allocation bug in tcindex_set_parms()
authorWANG Cong <xiyou.wangcong@gmail.com>
Mon, 15 Sep 2014 21:06:46 +0000 (14:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Sep 2014 21:48:23 +0000 (17:48 -0400)
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>
net/sched/cls_tcindex.c

index a9f4279fbd698ea2ecf177bd0dee26f9f7ff12ad..a02ca7298385f0c31139c25042934a22eb92d411 100644 (file)
@@ -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;