2007-12-23 03:48:06

by Stefano Brivio

[permalink] [raw]
Subject: [PATCH 4/7] rc80211-pid: fix sta_info refcounting

Fix a bug which caused uncorrect refcounting of PHYs in mac80211. Thanks to
Johannes Berg for spotting this out.

Cc: Johannes Berg <[email protected]>
Signed-off-by: Stefano Brivio <[email protected]>
---
rc80211_pid_algo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c
===================================================================
--- wireless-2.6.orig/net/mac80211/rc80211_pid_algo.c
+++ wireless-2.6/net/mac80211/rc80211_pid_algo.c
@@ -254,7 +254,7 @@ static void rate_control_pid_tx_status(v
/* Ignore all frames that were sent with a different rate than the rate
* we currently advise mac80211 to use. */
if (status->control.rate != &local->oper_hw_mode->rates[sta->txrate])
- return;
+ goto ignore;

spinfo = sta->rate_ctrl_priv;
spinfo->tx_num_xmit++;
@@ -295,6 +295,7 @@ static void rate_control_pid_tx_status(v
if (time_after(jiffies, spinfo->last_sample + period))
rate_control_pid_sample(pinfo, local, sta);

+ignore:
sta_info_put(sta);
}


--
Ciao
Stefano


2007-12-23 10:15:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 4/7] rc80211-pid: fix sta_info refcounting


On Sun, 2007-12-23 at 04:43 +0100, Stefano Brivio wrote:
> Fix a bug which caused uncorrect refcounting of PHYs in mac80211. Thanks to
> Johannes Berg for spotting this out.
>
> Cc: Johannes Berg <[email protected]>
> Signed-off-by: Stefano Brivio <[email protected]>

Yup, this looks like the correct fix.

Acked-by: Johannes Berg <[email protected]>

> ---
> rc80211_pid_algo.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c
> ===================================================================
> --- wireless-2.6.orig/net/mac80211/rc80211_pid_algo.c
> +++ wireless-2.6/net/mac80211/rc80211_pid_algo.c
> @@ -254,7 +254,7 @@ static void rate_control_pid_tx_status(v
> /* Ignore all frames that were sent with a different rate than the rate
> * we currently advise mac80211 to use. */
> if (status->control.rate != &local->oper_hw_mode->rates[sta->txrate])
> - return;
> + goto ignore;
>
> spinfo = sta->rate_ctrl_priv;
> spinfo->tx_num_xmit++;
> @@ -295,6 +295,7 @@ static void rate_control_pid_tx_status(v
> if (time_after(jiffies, spinfo->last_sample + period))
> rate_control_pid_sample(pinfo, local, sta);
>
> +ignore:
> sta_info_put(sta);
> }
>
>


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part