iwlwifi: allocate bigger nvm data in case of UHB
authorTova Mussai <tova.mussai@intel.com>
Thu, 4 Jul 2019 10:41:01 +0000 (13:41 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Sep 2019 12:31:21 +0000 (15:31 +0300)
In case of Ultra-high-band (UHB), need to allocate nvm data structure in
size of UHB channels array.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

index fd386bf..6d95941 100644 (file)
@@ -942,7 +942,11 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        u16 lar_config;
        const __le16 *ch_section;
 
-       if (cfg->nvm_type != IWL_NVM_EXT)
+       if (cfg->uhb_supported)
+               data = kzalloc(struct_size(data, channels,
+                                          IWL_NVM_NUM_CHANNELS_UHB),
+                                          GFP_KERNEL);
+       else if (cfg->nvm_type != IWL_NVM_EXT)
                data = kzalloc(struct_size(data, channels,
                                           IWL_NVM_NUM_CHANNELS),
                                           GFP_KERNEL);