From f43495fd5e37b2ef4a187974011ff439e6354053 Mon Sep 17 00:00:00 2001 From: Sara Sharon Date: Wed, 4 May 2016 14:22:10 +0300 Subject: [PATCH] iwlwifi: mvm: fix possible division by zero Theoretically we may get only one IRQ from OS, in which case we will have only 1 queue even in MSIx mode. This will cause division by zero in the indirection table calculation. We do not need send the command in that case, as there is only one queue so all RX traffic will be directed to it anyway. Bail out early if there is only one queue. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 7057f35cb2e7..0a5490c46d2e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -122,6 +122,9 @@ static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm) IWL_RSS_HASH_TYPE_IPV6_PAYLOAD, }; + if (mvm->trans->num_rx_queues == 1) + return 0; + /* Do not direct RSS traffic to Q 0 which is our fallback queue */ for (i = 0; i < ARRAY_SIZE(cmd.indirection_table); i++) cmd.indirection_table[i] = -- 2.45.2