iwlwifi: mvm: tighten BAID range check
authorJohannes Berg <johannes.berg@intel.com>
Wed, 3 Aug 2016 11:52:56 +0000 (13:52 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 16 Sep 2016 06:10:35 +0000 (09:10 +0300)
As pointed out by smatch, checking the BAID for just >= INVALID
is a bad idea since only 32 (IWL_MAX_BAID) actually exist. Check
the range for that and print invalid ones in the warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index 7845dbefb67a4eb0ab60f138486f3d1631ee1b30..d6d9ec401b44c6481e38982e81705174053bf132 100644 (file)
@@ -503,7 +503,7 @@ static void iwl_mvm_del_ba(struct iwl_mvm *mvm, int queue,
        struct iwl_mvm_reorder_buffer *reorder_buf;
        u8 baid = data->baid;
 
-       if (WARN_ON_ONCE(baid >= IWL_RX_REORDER_DATA_INVALID_BAID))
+       if (WARN_ONCE(baid >= IWL_MAX_BAID, "invalid BAID: %x\n", baid))
                return;
 
        rcu_read_lock();