From: Johannes Berg Date: Fri, 23 May 2014 14:13:57 +0000 (+0200) Subject: iwlwifi: mvm: validate that we don't send zero quota X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99a1230d9d1cb5d52bb37b8c03f3931502f0e44d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git iwlwifi: mvm: validate that we don't send zero quota The firmware currently deals with zero quota for a given binding, but it seems odd to send that down. Make sure that we don't do that. Signed-off-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- diff --git a/drivers/net/wireless/iwlwifi/mvm/quota.c b/drivers/net/wireless/iwlwifi/mvm/quota.c index 8bb2fced0811..3f18786311f4 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c @@ -297,6 +297,14 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *vif, iwl_mvm_adjust_quota_for_noa(mvm, &cmd); + /* check that we have non-zero quota for all valid bindings */ + for (i = 0; i < MAX_BINDINGS; i++) { + if (cmd.quotas[i].id_and_color == cpu_to_le32(FW_CTXT_INVALID)) + continue; + WARN_ONCE(cmd.quotas[i].quota == 0, + "zero quota on binding %d\n", i); + } + ret = iwl_mvm_send_cmd_pdu(mvm, TIME_QUOTA_CMD, 0, sizeof(cmd), &cmd); if (ret)