Skip to content

Commit

Permalink
wifi: cfg80211: adjust allocation of colocated AP data
Browse files Browse the repository at this point in the history
In 'cfg80211_scan_6ghz()', an instances of 'struct cfg80211_colocated_ap'
are allocated as if they would have 'ssid' as trailing VLA member. Since
this is not so, extra IEEE80211_MAX_SSID_LEN bytes are not needed.
Briefly tested with KUnit.

Fixes: c8cb5b8 ("nl80211/cfg80211: support 6 GHz scanning")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20250113155417.552587-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Dmitry Antipov authored and Johannes Berg committed Jan 15, 2025
1 parent a4058dc commit 1a0d247
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,7 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)
if (ret)
continue;

entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN,
GFP_ATOMIC);

entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (!entry)
continue;

Expand Down

0 comments on commit 1a0d247

Please sign in to comment.