mirror_ubuntu-kernels/drivers/net/wireless/intel/iwlwifi
Gustavo A. R. Silva 83ea00d687 iwlwifi: mvm: d3: 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>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-12-20 09:10:26 +02:00
..
cfg iwlwifi: remove all unnecessary occurrences of nvm_calib_ver 2018-12-14 13:04:47 +02:00
dvm iwlwifi: move iwl_nvm_check_version() into dvm 2018-12-14 13:04:46 +02:00
fw iwlwifi: remove unused and wrong PHY_CFG_* macros 2018-12-20 09:09:25 +02:00
mvm iwlwifi: mvm: d3: use struct_size() in kzalloc() 2018-12-20 09:10:26 +02:00
pcie iwlwifi: pcie: lock txq a bit later in reclaim code 2018-12-20 09:08:25 +02:00
iwl-agn-hw.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-config.h iwlwifi: don't define OTP_LOW_IMAGE_SIZE per family, but per size 2018-12-14 13:04:45 +02:00
iwl-context-info-gen3.h iwlwifi: update gen3 interrupts - sw error and image response 2018-07-26 13:16:16 +03:00
iwl-context-info.h iwlwifi: pcie: set RB size according to user settings 2018-09-28 08:57:27 +03:00
iwl-csr.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-dbg-tlv.c iwlwifi: dbg: add apply point logic 2018-11-23 13:01:06 +02:00
iwl-dbg-tlv.h iwlwifi: trans: support loading ini TLVs from external file 2018-11-23 13:01:06 +02:00
iwl-debug.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-debug.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-devtrace-data.h iwlwifi: trace: change trace to trace one TB at a time 2018-10-08 10:35:27 +03:00
iwl-devtrace-io.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-devtrace-iwlwifi.h iwlwifi: remove ucode error tracepoint 2018-09-28 08:57:22 +03:00
iwl-devtrace-msg.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-devtrace-ucode.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-devtrace.c iwlwifi: remove ucode error tracepoint 2018-09-28 08:57:22 +03:00
iwl-devtrace.h iwlwifi: add 80211 hdr offset to trace data 2018-08-31 11:38:29 +03:00
iwl-drv.c iwlwifi: add debugfs file to read fw debug data recording 2018-11-23 13:01:07 +02:00
iwl-drv.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-eeprom-parse.c iwlwifi: move iwl_nvm_check_version() into dvm 2018-12-14 13:04:46 +02:00
iwl-eeprom-parse.h iwlwifi: move iwl_nvm_check_version() into dvm 2018-12-14 13:04:46 +02:00
iwl-eeprom-read.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-eeprom-read.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-fh.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-io.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-io.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-modparams.h iwlwifi: trans: parse and store debug ini TLVs 2018-11-23 13:01:06 +02:00
iwl-nvm-parse.c iwlwifi: mvm: set TWT responder capability bit in 11AX SoftAP mode 2018-12-20 09:09:40 +02:00
iwl-nvm-parse.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-op-mode.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-phy-db.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-phy-db.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-prph.h iwlwifi: dbg: dump data according to the new ini TLVs 2018-12-14 13:04:44 +02:00
iwl-scd.h iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-trans.c iwlwifi: remove all occurrences of the FSF address paragraph 2018-08-31 11:38:33 +03:00
iwl-trans.h iwlwifi: add debugfs file to read fw debug data recording 2018-11-23 13:01:07 +02:00
Kconfig iwlwifi: make MVM and DVM depend on MAC80211 2018-12-20 09:07:03 +02:00
Makefile iwlwifi: trans: parse and store debug ini TLVs 2018-11-23 13:01:06 +02:00