diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-08-15 18:32:03 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-08-22 21:40:39 +0200 |
commit | abc76cf552e13cfa88a204b362a86b0e08e95228 (patch) | |
tree | 1310b1bd0ae15b446ffe78d4eb64965ca99654a3 /net/wireless | |
parent | wifi: cfg80211: reject auth/assoc to AP with our address (diff) | |
download | linux-abc76cf552e13cfa88a204b362a86b0e08e95228.tar.xz linux-abc76cf552e13cfa88a204b362a86b0e08e95228.zip |
wifi: cfg80211: ocb: don't leave if not joined
If there's no OCB state, don't ask the driver/mac80211 to
leave, since that's just confusing. Since set/clear the
chandef state, that's a simple check.
Reported-by: syzbot+09d1cd2f71e6dd3bfd2c@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/ocb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/ocb.c b/net/wireless/ocb.c index 27a1732264f9..29afaf3da54f 100644 --- a/net/wireless/ocb.c +++ b/net/wireless/ocb.c @@ -68,6 +68,9 @@ int __cfg80211_leave_ocb(struct cfg80211_registered_device *rdev, if (!rdev->ops->leave_ocb) return -EOPNOTSUPP; + if (!wdev->u.ocb.chandef.chan) + return -ENOTCONN; + err = rdev_leave_ocb(rdev, dev); if (!err) memset(&wdev->u.ocb.chandef, 0, sizeof(wdev->u.ocb.chandef)); |