mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 11:21:33 +00:00
iwlwifi: dbg_ini: fix bad dump size calculation
The driver initiates the size value with the size of the struct and then
adds the size of the data and checks if the size is zero so size can not
be equal to zero.
Solve this by getting the data size, check that it is not equal to zero
and only then add the struct size.
Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 7a14c23dcd
("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
parent
8625794e36
commit
b05d57c9b6
@ -1809,12 +1809,12 @@ _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt,
|
||||
|
||||
trigger = fwrt->dump.active_trigs[id].trig;
|
||||
|
||||
size = sizeof(*dump_file);
|
||||
size += iwl_fw_ini_get_trigger_len(fwrt, trigger);
|
||||
|
||||
size = iwl_fw_ini_get_trigger_len(fwrt, trigger);
|
||||
if (!size)
|
||||
return NULL;
|
||||
|
||||
size += sizeof(*dump_file);
|
||||
|
||||
dump_file = vzalloc(size);
|
||||
if (!dump_file)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user