diff options
author | Johannes Berg <johannes.berg@intel.com> | 2021-03-30 16:24:58 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2021-04-14 12:07:16 +0300 |
commit | 48a5494d6a4cb5812f0640d9515f1876ffc7a013 (patch) | |
tree | 6af455d88c91def78dda11ba152a7138afa85a35 /drivers/fpga/zynqmp-fpga.c | |
parent | d4626f91739b76633dbb3013e843e178c4a26618 (diff) |
iwlwifi: pcie: make cfg vs. trans_cfg more robust
If we (for example) have a trans_cfg entry in the PCI IDs table,
but then don't find a full cfg entry for it in the info table,
we fall through to the code that treats the PCI ID table entry
as a full cfg entry. This obviously causes crashes later, e.g.
when trying to build the firmware name string.
Avoid such crashes by using the low bit of the pointer as a tag
for trans_cfg entries (automatically using a macro that checks
the type when assigning) and then checking that before trying to
use the data as a full entry - if it's just a partial entry at
that point, fail.
Since we're adding some macro magic, also check that the type is
in fact either struct iwl_cfg_trans_params or struct iwl_cfg,
failing compilation ("initializer element is not constant") if
it isn't.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.6f69fe6e4128.I921d4ae20ef5276716baeeeda0b001cf25b9b968@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/fpga/zynqmp-fpga.c')
0 files changed, 0 insertions, 0 deletions