linux_dsm_epyc7002/drivers/net/wireless
Gustavo A. R. Silva 0cf83903aa brcmfmac: Use struct_size() in kzalloc()
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 = kzalloc(size, GFP_KERNEL)

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

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL)

Notice that, in this case, variable reqsz is not necessary,
hence it is removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-13 13:58:36 +03:00
..
admtek
ath wil6210: check null pointer in _wil_cfg80211_merge_extra_ies 2019-02-28 11:25:09 +02:00
atmel atmel: Replace mdelay() with msleep() in probe_atmel_card() 2018-07-31 10:25:33 +03:00
broadcom brcmfmac: Use struct_size() in kzalloc() 2019-04-13 13:58:36 +03:00
cisco Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-12-27 13:53:32 -08:00
intel Second batch of patches intended for v5.2 2019-04-13 13:45:03 +03:00
intersil orinoco : Replace function name in string with __func__ 2019-02-19 17:17:13 +02:00
marvell mwifiex: add a bounds check in mwifiex_process_sta_rx_packet() 2019-04-04 13:20:47 +03:00
mediatek mt76x02: do not enable RTS/CTS by default 2019-03-19 17:37:25 +02:00
quantenna qtnfmac: replace qtnf_cmd_acl_data_size() with struct_size() 2019-04-04 19:38:36 +03:00
ralink rt2800: comment and simplify AGC init for RT6352 2019-02-19 17:18:57 +02:00
realtek rtlwifi: move spin_lock_bh to spin_lock in tasklet 2019-04-04 13:26:40 +03:00
rsi rsi: fix missing null pointer check from a failed ieee80211_probereq_get call 2019-02-28 10:28:36 +02:00
st cw1200: no need to check return value of debugfs_create functions 2019-02-01 14:34:56 +02:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-08 15:00:17 -08:00
zydas zd1201: mark expected switch fall-through 2018-11-06 19:00:12 +02:00
Kconfig mac80211-next: rtnetlink wifi simulation device 2018-12-05 15:31:31 +01:00
mac80211_hwsim.c genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
mac80211_hwsim.h mac80211_hwsim: allow configurable cipher types 2018-11-09 11:36:15 +01:00
Makefile mac80211-next: rtnetlink wifi simulation device 2018-12-05 15:31:31 +01:00
ray_cs.c wireless: remove unneeded semicolon 2019-02-01 14:25:41 +02:00
ray_cs.h
rayctl.h
rndis_wlan.c wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types 2018-06-27 19:07:39 +03:00
virt_wifi.c virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED 2019-02-11 17:10:48 +01:00
wl3501_cs.c
wl3501.h