* [PATCH 3.11] cfg80211: don't request disconnect if not connected
@ 2013-08-13 7:29 Johannes Berg
2013-08-14 12:00 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2013-08-13 7:29 UTC (permalink / raw)
To: linux-wireless; +Cc: neilb, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Neil Brown reports that with libertas, my recent cfg80211
SME changes in commit ceca7b7121795ef81bd598a240d53a92566
("cfg80211: separate internal SME implementation") broke
libertas suspend because it we now asked it to disconnect
while already disconnected.
The problematic change is in cfg80211_disconnect() as it
previously checked the SME state and now calls the driver
disconnect operation unconditionally.
Fix this by checking if there's a current_bss indicating
a connection, and do nothing if not.
Reported-and-tested-by: Neil Brown <neilb@suse.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/sme.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 81c8a10..20e86a9 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -976,21 +976,19 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
struct net_device *dev, u16 reason, bool wextev)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
- int err;
+ int err = 0;
ASSERT_WDEV_LOCK(wdev);
kfree(wdev->connect_keys);
wdev->connect_keys = NULL;
- if (wdev->conn) {
+ if (wdev->conn)
err = cfg80211_sme_disconnect(wdev, reason);
- } else if (!rdev->ops->disconnect) {
+ else if (!rdev->ops->disconnect)
cfg80211_mlme_down(rdev, dev);
- err = 0;
- } else {
+ else if (wdev->current_bss)
err = rdev_disconnect(rdev, dev, reason);
- }
return err;
}
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 3.11] cfg80211: don't request disconnect if not connected
2013-08-13 7:29 [PATCH 3.11] cfg80211: don't request disconnect if not connected Johannes Berg
@ 2013-08-14 12:00 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2013-08-14 12:00 UTC (permalink / raw)
To: linux-wireless; +Cc: neilb
On Tue, 2013-08-13 at 09:29 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Neil Brown reports that with libertas, my recent cfg80211
> SME changes in commit ceca7b7121795ef81bd598a240d53a92566
> ("cfg80211: separate internal SME implementation") broke
> libertas suspend because it we now asked it to disconnect
> while already disconnected.
>
> The problematic change is in cfg80211_disconnect() as it
> previously checked the SME state and now calls the driver
> disconnect operation unconditionally.
>
> Fix this by checking if there's a current_bss indicating
> a connection, and do nothing if not.
Applied.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-14 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 7:29 [PATCH 3.11] cfg80211: don't request disconnect if not connected Johannes Berg
2013-08-14 12:00 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox