[ Also I was wondering if you could take a look at:

        net/sched/cls_tcindex.c:259 tcindex_set_parms()
        warn: missing error code here? 'kmemdup()' failed.

   255          if (p->perfect) {
   256                  cp->perfect = kmemdup(p->perfect,
   257                                        sizeof(*r) * cp->hash, 
GFP_KERNEL);
   258                  if (!cp->perfect)
   259                          goto errout;

err = -ENOMEM here?

   260          }
   261          cp->h = p->h;

 -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   b25bd2515ea32cf5ddd5fd5a2a93b8c9dd875e4f
commit: 331b72922c5f58d48fd5500acadc91777cc31970 [184/193] net: sched: RCU 
cls_tcindex

New smatch warnings:
net/sched/cls_tcindex.c:244 tcindex_set_parms() error: not allocating enough 
data 40 vs 4

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout 331b72922c5f58d48fd5500acadc91777cc31970
vim +244 net/sched/cls_tcindex.c

^1da177e Linus Torvalds 2005-04-16  228         int err, balloc = 0;
^1da177e Linus Torvalds 2005-04-16  229         struct tcindex_filter_result 
new_filter_result, *old_r = r;
^1da177e Linus Torvalds 2005-04-16  230         struct tcindex_filter_result cr;
331b7292 John Fastabend 2014-09-12  231         struct tcindex_data *cp, *oldp;
^1da177e Linus Torvalds 2005-04-16  232         struct tcindex_filter *f = 
NULL; /* make gcc behave */
^1da177e Linus Torvalds 2005-04-16  233         struct tcf_exts e;
^1da177e Linus Torvalds 2005-04-16  234  
5da57f42 WANG Cong      2013-12-15  235         tcf_exts_init(&e, 
TCA_TCINDEX_ACT, TCA_TCINDEX_POLICE);
2f7ef2f8 Cong Wang      2014-04-25  236         err = tcf_exts_validate(net, 
tp, tb, est, &e, ovr);
^1da177e Linus Torvalds 2005-04-16  237         if (err < 0)
^1da177e Linus Torvalds 2005-04-16  238                 return err;
^1da177e Linus Torvalds 2005-04-16  239  
331b7292 John Fastabend 2014-09-12  240         /* tcindex_data attributes must 
look atomic to classifier/lookup so
331b7292 John Fastabend 2014-09-12  241          * allocate new tcindex data 
and RCU assign it onto root. Keeping
331b7292 John Fastabend 2014-09-12  242          * perfect hash and hash 
pointers from old data.
331b7292 John Fastabend 2014-09-12  243          */
331b7292 John Fastabend 2014-09-12 @244         cp = kzalloc(sizeof(cp), 
GFP_KERNEL);
                                                             ^^^^^^^^^^
This should be sizeof(*cp) obviously.

331b7292 John Fastabend 2014-09-12  245         if (!cp)
331b7292 John Fastabend 2014-09-12  246                 return -ENOMEM;
331b7292 John Fastabend 2014-09-12  247  
331b7292 John Fastabend 2014-09-12  248         cp->mask = p->mask;
331b7292 John Fastabend 2014-09-12  249         cp->shift = p->shift;
331b7292 John Fastabend 2014-09-12  250         cp->hash = p->hash;
331b7292 John Fastabend 2014-09-12  251         cp->alloc_hash = p->alloc_hash;
331b7292 John Fastabend 2014-09-12  252         cp->fall_through = 
p->fall_through;

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to