From: Ilan Peer Date: Sun, 19 Jan 2014 09:46:52 +0000 (+0200) Subject: iwlwifi: mvm: add the quota remainder to a data binding X-Git-Tag: v3.15-rc1~113^2~18^2^2~371^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d675e523740d20fea8b8b76b4163aa18811c288;p=platform%2Fkernel%2Flinux-exynos.git iwlwifi: mvm: add the quota remainder to a data binding Currently the quota remainder was added to the first binding, although it is possible that this was not a data binding (only the P2P_DEVICE interface is part of the binding). Fix this by adding the remainder to the first binding that was actually allocated quota. Signed-off-by: Ilan Peer Reviewed-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 5691a85..f07ae48 100644 --- a/drivers/net/wireless/iwlwifi/mvm/quota.c +++ b/drivers/net/wireless/iwlwifi/mvm/quota.c @@ -276,8 +276,13 @@ int iwl_mvm_update_quotas(struct iwl_mvm *mvm, struct ieee80211_vif *newvif) idx++; } - /* Give the remainder of the session to the first binding */ - le32_add_cpu(&cmd.quotas[0].quota, quota_rem); + /* Give the remainder of the session to the first data binding */ + for (i = 0; i < MAX_BINDINGS; i++) { + if (le32_to_cpu(cmd.quotas[i].quota) != 0) { + le32_add_cpu(&cmd.quotas[i].quota, quota_rem); + break; + } + } iwl_mvm_adjust_quota_for_noa(mvm, &cmd);