summaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 20:24:42 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 20:24:42 +0200
commitcbb245239282870bc6f54d5137dfe0f84b48ea72 (patch)
treedcdd8041d7bb5cddacfe086785dd370aa1a7a6ea /net/wireless/scan.c
parentInput: ims-pcu - replace some spaces with tabs (diff)
parentLinux 5.12 (diff)
downloadlinux-cbb245239282870bc6f54d5137dfe0f84b48ea72.tar.xz
linux-cbb245239282870bc6f54d5137dfe0f84b48ea72.zip
Merge tag 'v5.12' into next
Sync up with mainline to get the latest device tree bindings and kernel APIs.
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 019952d4fc7d..758eb7d2a706 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2352,14 +2352,16 @@ cfg80211_inform_single_bss_frame_data(struct wiphy *wiphy,
return NULL;
if (ext) {
- struct ieee80211_s1g_bcn_compat_ie *compat;
- u8 *ie;
+ const struct ieee80211_s1g_bcn_compat_ie *compat;
+ const struct element *elem;
- ie = (void *)cfg80211_find_ie(WLAN_EID_S1G_BCN_COMPAT,
- variable, ielen);
- if (!ie)
+ elem = cfg80211_find_elem(WLAN_EID_S1G_BCN_COMPAT,
+ variable, ielen);
+ if (!elem)
+ return NULL;
+ if (elem->datalen < sizeof(*compat))
return NULL;
- compat = (void *)(ie + 2);
+ compat = (void *)elem->data;
bssid = ext->u.s1g_beacon.sa;
capability = le16_to_cpu(compat->compat_info);
beacon_int = le16_to_cpu(compat->beacon_int);