iwlwifi: mvm: check ARRAY_SIZE(mvm->fw_id_to_mac_id) = IWL_MVM_STATION_COUNT
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 14 Jan 2014 06:45:26 +0000 (08:45 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 3 Feb 2014 20:23:33 +0000 (22:23 +0200)
Since we use IWL_MVM_STATION_COUNT all over the driver, we
need to make sure that it is the right constant to look at.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/ops.c

index f38ed9fb356a991b3be5ee9ab2db68af1e693c16..5e4d56ed88a41c99c34c5cd2197b08d38e7c3f45 100644 (file)
@@ -338,6 +338,13 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        };
        int err, scan_size;
 
+       /*
+        * We use IWL_MVM_STATION_COUNT to check the validity of the station
+        * index all over the driver - check that its value corresponds to the
+        * array size.
+        */
+       BUILD_BUG_ON(ARRAY_SIZE(mvm->fw_id_to_mac_id) != IWL_MVM_STATION_COUNT);
+
        /********************************
         * 1. Allocating and configuring HW data
         ********************************/