linux/net/sched
Gustavo A. R. Silva 8fe5756c73 net/sched: use struct_size() helper
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    struct boo entry[];
};

size = sizeof(struct foo) + count * sizeof(struct boo);
instance = alloc(size, GFP_KERNEL)

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

size = struct_size(instance, entry, count);
instance = alloc(size, GFP_KERNEL)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-08 22:57:27 -08:00
..
act_api.c net/sched: Remove egdev mechanism 2018-12-10 15:54:34 -08:00
act_bpf.c
act_connmark.c
act_csum.c
act_gact.c
act_ife.c
act_ipt.c
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c
act_mirred.c act_mirred: clear skb->tstamp on redirect 2018-11-11 10:21:31 -08:00
act_nat.c
act_pedit.c net/sched: use struct_size() helper 2019-02-08 22:57:27 -08:00
act_police.c net/sched: act_police: fix memory leak in case of invalid control action 2018-11-30 17:14:06 -08:00
act_sample.c
act_simple.c
act_skbedit.c
act_skbmod.c
act_tunnel_key.c net/sched: act_tunnel_key: fix memory leak in case of action replace 2019-01-15 21:38:48 -08:00
act_vlan.c net/core: use __vlan_hwaccel helpers 2018-11-08 20:45:04 -08:00
cls_api.c cls_api: add translator to flow_action representation 2019-02-06 10:38:25 -08:00
cls_basic.c net_sched: add performance counters for basic filter 2019-01-19 16:05:42 -08:00
cls_bpf.c net_sched: fold tcf_block_cb_call() into tc_setup_cb_call() 2018-12-14 15:32:19 -08:00
cls_cgroup.c
cls_flow.c
cls_flower.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
cls_fw.c
cls_matchall.c net_sched: add hit counter for matchall 2019-01-18 14:13:50 -08:00
cls_route.c
cls_rsvp.c
cls_rsvp.h
cls_rsvp6.c
cls_tcindex.c
cls_u32.c net_sched: fold tcf_block_cb_call() into tc_setup_cb_call() 2018-12-14 15:32:19 -08:00
em_canid.c
em_cmp.c
em_ipset.c
em_ipt.c
em_meta.c
em_nbyte.c
em_text.c
em_u32.c
ematch.c
Kconfig
Makefile
sch_api.c sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints 2019-01-19 09:53:18 -08:00
sch_atm.c
sch_blackhole.c
sch_cake.c sch_cake: Correctly update parent qlen when splitting GSO packets 2019-01-15 20:12:01 -08:00
sch_cbq.c
sch_cbs.c sched: Avoid dereferencing skb pointer after child enqueue 2019-01-15 20:12:00 -08:00
sch_choke.c
sch_codel.c
sch_drr.c sched: Fix detection of empty queues in child qdiscs 2019-01-15 20:12:00 -08:00
sch_dsmark.c sched: Avoid dereferencing skb pointer after child enqueue 2019-01-15 20:12:00 -08:00
sch_etf.c etf: Drop all expired packets 2018-11-16 20:39:34 -08:00
sch_fifo.c
sch_fq.c net_sched: sch_fq: avoid calling ktime_get_ns() if not needed 2018-11-20 09:51:32 -08:00
sch_fq_codel.c
sch_generic.c net/sched: Replace call_rcu_bh() and rcu_barrier_bh() 2018-12-01 12:38:46 -08:00
sch_gred.c net: sched: gred: support reporting stats from offloads 2018-11-19 18:53:46 -08:00
sch_hfsc.c sched: Fix detection of empty queues in child qdiscs 2019-01-15 20:12:00 -08:00
sch_hhf.c
sch_htb.c sched: Avoid dereferencing skb pointer after child enqueue 2019-01-15 20:12:00 -08:00
sch_ingress.c
sch_mq.c net: sched: mq: offload a graft notification 2018-11-14 08:51:28 -08:00
sch_mqprio.c
sch_multiq.c
sch_netem.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-12-09 21:43:31 -08:00
sch_pie.c
sch_plug.c
sch_prio.c sched: Avoid dereferencing skb pointer after child enqueue 2019-01-15 20:12:00 -08:00
sch_qfq.c sched: Fix detection of empty queues in child qdiscs 2019-01-15 20:12:00 -08:00
sch_red.c net: sched: red: notify drivers about RED's limit parameter 2018-11-14 08:51:28 -08:00
sch_sfb.c
sch_sfq.c
sch_skbprio.c
sch_taprio.c
sch_tbf.c sched: Avoid dereferencing skb pointer after child enqueue 2019-01-15 20:12:00 -08:00
sch_teql.c