All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, karl.beldan@gmail.com
Subject: Re: [PATCH v5 1/3] mac80211: improve the rate control API
Date: Mon, 22 Apr 2013 15:52:46 +0200	[thread overview]
Message-ID: <1366638766.8637.16.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1366625393-11647-1-git-send-email-nbd@openwrt.org>

On Mon, 2013-04-22 at 12:09 +0200, Felix Fietkau wrote:

> @@ -692,16 +692,38 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
>  	 */
>  	rate_control_get_rate(tx->sdata, tx->sta, &txrc);
>  
> -	if (unlikely(info->control.rates[0].idx < 0))
> -		return TX_DROP;
> +	if (tx->sta && !info->control.skip_table)
> +		ratetbl = rcu_dereference(tx->sta->sta.rates);
> +
> +	if (unlikely(info->control.rates[0].idx < 0)) {
> +		if (ratetbl) {
> +			struct ieee80211_tx_rate rate = {
> +				.idx = ratetbl->rate[0].idx,
> +				.flags = ratetbl->rate[0].flags,
> +				.count = ratetbl->rate[0].count
> +			};
> +
> +			if (ratetbl->rate[0].idx < 0)
> +				return TX_DROP;

This can't happen, idx is unsigned. Did you intend idx to be signed?

johannes


  parent reply	other threads:[~2013-04-22 13:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 10:09 [PATCH v5 1/3] mac80211: improve the rate control API Felix Fietkau
2013-04-22 10:09 ` [PATCH v5 2/3] mac80211/minstrel_ht: use the new " Felix Fietkau
2013-04-22 10:09 ` [PATCH v5 3/3] mac80211/minstrel: " Felix Fietkau
2013-04-22 10:21 ` [PATCH v5 1/3] mac80211: improve the " Karl Beldan
2013-04-22 13:52 ` Johannes Berg [this message]
2013-04-22 14:08   ` Felix Fietkau
2013-04-22 14:16     ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366638766.8637.16.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=karl.beldan@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@openwrt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.