1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless
Gustavo A. R. Silva 06ae8dc004 ath10k: 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;
        void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, 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);

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-08-28 16:42:54 +03:00
..
admtek net/wireless: fix spaces and grammar copy/paste in vendor Kconfig help text 2018-03-13 18:52:25 +02:00
ath ath10k: use struct_size() in kzalloc() 2018-08-28 16:42:54 +03:00
atmel atmel: Replace mdelay() with msleep() in probe_atmel_card() 2018-07-31 10:25:33 +03:00
broadcom wireless-drivers-next patches for 4.19 2018-08-05 17:36:01 -07:00
cisco airo: remove unused variables len and dev and clean up formatting 2018-07-31 10:17:19 +03:00
intel wireless-drivers-next patches for 4.19 2018-08-05 17:36:01 -07:00
intersil hostap: hide unused procfs helpers 2018-07-31 10:21:33 +03:00
marvell mwifiex: Fix skipped vendor specific IEs 2018-07-31 10:13:39 +03:00
mediatek mt76x0: rename trace symbols 2018-08-04 09:06:15 +03:00
quantenna qtnfmac: implement basic WoWLAN support 2018-08-02 21:55:49 +03:00
ralink rt2x00: remove redundant functions rt2x00mac_sta_{add/remove} 2018-07-31 10:27:40 +03:00
realtek rtl818x: Replace mdelay() with msleep() in rtl8225se_rf_init 2018-07-31 10:26:46 +03:00
rsi rsi: move init_done flag to end of rsi_91x_init(). 2018-07-31 10:16:05 +03:00
st treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
ti wlcore: Set rx_status boottime_ns field on rx 2018-07-31 10:24:10 +03:00
zydas zd1211rw: use irqsave() in USB's complete callback 2018-06-27 19:12:43 +03:00
Kconfig qtnfmac: introduce new FullMAC driver for Quantenna chipsets 2017-05-24 17:04:13 +03:00
mac80211_hwsim.c mac80211_hwsim: Add support for HE 2018-07-09 10:21:28 +02:00
mac80211_hwsim.h mac80211_hwsim: add permanent mac address option for new radios 2018-01-31 12:45:35 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ray_cs.c ray_cs: remove redundant pointer 'p' 2018-07-31 10:19:50 +03:00
ray_cs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rayctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rndis_wlan.c wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types 2018-06-27 19:07:39 +03:00
wl3501.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wl3501_cs.c wl3501_cs: fix spelling mistake: "Insupported" -> "Unsupported" 2017-07-28 18:06:31 +03:00