iwlwifi: dbg_ini: fix bad dump size calculation
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Tue, 12 Feb 2019 07:56:49 +0000 (09:56 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Mar 2019 10:49:04 +0000 (12:49 +0200)
commitb05d57c9b647b77edf9ac4550c493cf77c3923c7
treee78db2e4fc27bbdcc0f13fbe16261cbd93265906
parent8625794e363946d153c5bc57ed30ab7616a9995a
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: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c