2010-12-07 22:06:45

by Ben Greear

[permalink] [raw]
Subject: [PATCH] wireless: Remove spurious warning in mlme.c

From: Ben Greear <[email protected]>

Seems that we should not be warning if all of the
authtry_bsses are already NULL.

Signed-off-by: Ben Greear <[email protected]>
---
:100644 100644 d7680f2... 866d016... M net/wireless/mlme.c
net/wireless/mlme.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index d7680f2..866d016 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -266,7 +266,7 @@ EXPORT_SYMBOL(cfg80211_send_disassoc);
static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
{
int i;
- bool done = false;
+ bool done = true;

ASSERT_WDEV_LOCK(wdev);

@@ -277,9 +277,10 @@ static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
cfg80211_unhold_bss(wdev->authtry_bsses[i]);
cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
wdev->authtry_bsses[i] = NULL;
- done = true;
break;
}
+ else if (wdev->authtry_bsses[i])
+ done = false;
}

WARN_ON(!done);
--
1.7.2.3



2010-12-07 23:06:10

by Gábor Stefanik

[permalink] [raw]
Subject: Re: [PATCH] wireless: Remove spurious warning in mlme.c

On Tue, Dec 7, 2010 at 11:06 PM, <[email protected]> wrote:
> From: Ben Greear <[email protected]>
>
> Seems that we should not be warning if all of the
> authtry_bsses are already NULL.
>
> Signed-off-by: Ben Greear <[email protected]>
> ---
> :100644 100644 d7680f2... 866d016... M ?net/wireless/mlme.c
> ?net/wireless/mlme.c | ? ?5 +++--
> ?1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index d7680f2..866d016 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -266,7 +266,7 @@ EXPORT_SYMBOL(cfg80211_send_disassoc);
> ?static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
> ?{
> ? ? ? ?int i;
> - ? ? ? bool done = false;
> + ? ? ? bool done = true;
>
> ? ? ? ?ASSERT_WDEV_LOCK(wdev);
>
> @@ -277,9 +277,10 @@ static void __cfg80211_auth_remove(struct wireless_dev *wdev, const u8 *addr)
> ? ? ? ? ? ? ? ? ? ? ? ?cfg80211_unhold_bss(wdev->authtry_bsses[i]);
> ? ? ? ? ? ? ? ? ? ? ? ?cfg80211_put_bss(&wdev->authtry_bsses[i]->pub);
> ? ? ? ? ? ? ? ? ? ? ? ?wdev->authtry_bsses[i] = NULL;
> - ? ? ? ? ? ? ? ? ? ? ? done = true;
> ? ? ? ? ? ? ? ? ? ? ? ?break;
> ? ? ? ? ? ? ? ?}
> + ? ? ? ? ? ? ? else if (wdev->authtry_bsses[i])
> + ? ? ? ? ? ? ? ? ? ? ? done = false;

Coding style issues: always put the else on the same line as the
closing brace, and if one branch is braced, both branches should be
so.

> ? ? ? ?}
>
> ? ? ? ?WARN_ON(!done);
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>



--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

2010-12-08 08:11:46

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] wireless: Remove spurious warning in mlme.c

On Tue, 2010-12-07 at 14:06 -0800, [email protected] wrote:
> From: Ben Greear <[email protected]>
>
> Seems that we should not be warning if all of the
> authtry_bsses are already NULL.

Do you keep running into the warning? I'd really like to understand how
it happens -- it seems to point to a mac80211 bug.

So don't really like this patch.

johannes


2010-12-08 15:36:40

by Ben Greear

[permalink] [raw]
Subject: Re: [PATCH] wireless: Remove spurious warning in mlme.c

On 12/08/2010 12:11 AM, Johannes Berg wrote:
> On Tue, 2010-12-07 at 14:06 -0800, [email protected] wrote:
>> From: Ben Greear<[email protected]>
>>
>> Seems that we should not be warning if all of the
>> authtry_bsses are already NULL.
>
> Do you keep running into the warning? I'd really like to understand how
> it happens -- it seems to point to a mac80211 bug.
>
> So don't really like this patch.

Yes, it's easily repeatable in my setup when using wpa_supplicant
for non-encrypted VIFS. I was using around 80 VIFS for most of this testing.

I posted the backtrace to no comment several weeks ago:

http://www.spinics.net/lists/linux-wireless/msg59525.html

Thanks,
Ben

>
> johannes


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com