linux/drivers/net
Gustavo A. R. Silva cc5b48b567 freescale: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

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

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 7649773293 ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24 15:26:17 -08:00
..
appletalk
arcnet
bonding net/bond: Delete driver and module versions 2020-02-24 11:23:36 -08:00
caif
can
dsa net: dsa: felix: Use PHY_INTERFACE_MODE_INTERNAL instead of GMII 2020-02-24 15:12:10 -08:00
ethernet freescale: Replace zero-length array with flexible-array member 2020-02-24 15:26:17 -08:00
fddi
fjes
hamradio
hippi
hyperv hv_netvsc: use new helper tcp_v6_gso_csum_prep 2020-02-19 11:20:59 -08:00
ieee802154
ipvlan
netdevsim netdevsim: fix ptr_ret.cocci warnings 2020-02-05 13:55:32 +01:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-21 13:39:34 -08:00
plip
ppp
slip
team
usb r8152: use new helper tcp_v6_gso_csum_prep 2020-02-19 11:21:00 -08:00
vmxnet3 vmxnet3: use new helper tcp_v6_gso_csum_prep 2020-02-19 11:21:00 -08:00
wan ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
wimax
wireguard wireguard: socket: remove extra call to synchronize_net 2020-02-16 19:21:56 -08:00
wireless A few big new things: 2020-02-16 19:00:22 -08:00
xen-netback
bareudp.c bareudp: Fix uninitialized variable warnings. 2020-02-24 14:40:54 -08:00
dummy.c net/dummy: Ditch driver and module versions 2020-02-24 11:23:36 -08:00
eql.c
geneve.c
gtp.c gtp: use icmp_ndo_send helper 2020-02-13 14:19:00 -08:00
ifb.c
Kconfig net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc. 2020-02-24 13:31:42 -08:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c
macvtap.c
Makefile net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc. 2020-02-24 13:31:42 -08:00
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: Remove unnecessary BUG_ON check in tun_net_xmit 2020-02-23 16:39:21 -08:00
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c