Skip to content

Commit

Permalink
cfg80211: fix disassoc while not associated
Browse files Browse the repository at this point in the history
When trying to disassociate while not associated,
the kernel would crash rather than refusing the
operation, fix this;

Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 29, 2009
1 parent fec247c commit f9d6b40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,12 @@ static int __cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,

ASSERT_WDEV_LOCK(wdev);

if (wdev->sme_state != CFG80211_SME_CONNECTED)
return -ENOTCONN;

if (WARN_ON(!wdev->current_bss))
return -ENOTCONN;

memset(&req, 0, sizeof(req));
req.reason_code = reason;
req.ie = ie;
Expand Down

0 comments on commit f9d6b40

Please sign in to comment.