From: Lee Jones <lee.jones@linaro.org>
To: lee.jones@linaro.org
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sumera Priyadarsini <sylphrenadin@gmail.com>,
linux-staging@lists.linux.dev
Subject: [PATCH 07/57] staging: wlan-ng: cfg80211: Move large struct onto the heap
Date: Wed, 14 Apr 2021 19:10:39 +0100 [thread overview]
Message-ID: <20210414181129.1628598-8-lee.jones@linaro.org> (raw)
In-Reply-To: <20210414181129.1628598-1-lee.jones@linaro.org>
Fixes the following W=1 kernel build warning(s):
drivers/staging/wlan-ng/cfg80211.c: In function ‘prism2_scan’:
drivers/staging/wlan-ng/cfg80211.c:388:1: warning: the frame size of 1296 bytes is larger than 1024 bytes [-Wframe-larger-than=]
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sumera Priyadarsini <sylphrenadin@gmail.com>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/staging/wlan-ng/cfg80211.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 759e475e303c0..7951bd63816ff 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -276,7 +276,7 @@ static int prism2_scan(struct wiphy *wiphy,
struct prism2_wiphy_private *priv = wiphy_priv(wiphy);
struct wlandevice *wlandev;
struct p80211msg_dot11req_scan msg1;
- struct p80211msg_dot11req_scan_results msg2;
+ struct p80211msg_dot11req_scan_results *msg2;
struct cfg80211_bss *bss;
struct cfg80211_scan_info info = {};
@@ -301,6 +301,10 @@ static int prism2_scan(struct wiphy *wiphy,
return -EOPNOTSUPP;
}
+ msg2 = kzalloc(sizeof(*msg2), GFP_KERNEL);
+ if (!msg2)
+ return -ENOMEM;
+
priv->scan_request = request;
memset(&msg1, 0x00, sizeof(msg1));
@@ -342,31 +346,30 @@ static int prism2_scan(struct wiphy *wiphy,
for (i = 0; i < numbss; i++) {
int freq;
- memset(&msg2, 0, sizeof(msg2));
- msg2.msgcode = DIDMSG_DOT11REQ_SCAN_RESULTS;
- msg2.bssindex.data = i;
+ msg2->msgcode = DIDMSG_DOT11REQ_SCAN_RESULTS;
+ msg2->bssindex.data = i;
result = p80211req_dorequest(wlandev, (u8 *)&msg2);
if ((result != 0) ||
- (msg2.resultcode.data != P80211ENUM_resultcode_success)) {
+ (msg2->resultcode.data != P80211ENUM_resultcode_success)) {
break;
}
ie_buf[0] = WLAN_EID_SSID;
- ie_buf[1] = msg2.ssid.data.len;
+ ie_buf[1] = msg2->ssid.data.len;
ie_len = ie_buf[1] + 2;
- memcpy(&ie_buf[2], &msg2.ssid.data.data, msg2.ssid.data.len);
- freq = ieee80211_channel_to_frequency(msg2.dschannel.data,
+ memcpy(&ie_buf[2], &msg2->ssid.data.data, msg2->ssid.data.len);
+ freq = ieee80211_channel_to_frequency(msg2->dschannel.data,
NL80211_BAND_2GHZ);
bss = cfg80211_inform_bss(wiphy,
ieee80211_get_channel(wiphy, freq),
CFG80211_BSS_FTYPE_UNKNOWN,
- (const u8 *)&msg2.bssid.data.data,
- msg2.timestamp.data, msg2.capinfo.data,
- msg2.beaconperiod.data,
+ (const u8 *)&msg2->bssid.data.data,
+ msg2->timestamp.data, msg2->capinfo.data,
+ msg2->beaconperiod.data,
ie_buf,
ie_len,
- (msg2.signal.data - 65536) * 100, /* Conversion to signed type */
+ (msg2->signal.data - 65536) * 100, /* Conversion to signed type */
GFP_KERNEL);
if (!bss) {
@@ -378,12 +381,13 @@ static int prism2_scan(struct wiphy *wiphy,
}
if (result)
- err = prism2_result2err(msg2.resultcode.data);
+ err = prism2_result2err(msg2->resultcode.data);
exit:
info.aborted = !!(err);
cfg80211_scan_done(request, &info);
priv->scan_request = NULL;
+ kfree(msg2);
return err;
}
--
2.27.0
next prev parent reply other threads:[~2021-04-14 18:12 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 18:10 [PATCH 00/57] Rid W=1 warnings from Staging Lee Jones
2021-04-14 18:10 ` [PATCH 01/57] staging: r8192U_core: Remove unused variable 'ret' and demote kernel-doc abuse Lee Jones
2021-04-14 18:10 ` [PATCH 02/57] staging: android: ashmem: Supply description for 'new_range' Lee Jones
2021-04-15 16:30 ` Todd Kjos
2021-04-14 18:10 ` [PATCH 03/57] staging: comedi_8254: Fix descriptions for 'i8254' and 'iobase' Lee Jones
2021-04-14 18:10 ` [PATCH 04/57] staging: r8192U_core: Do not use kernel-doc formatting for !kernel-doc headers Lee Jones
2021-04-14 18:10 ` [PATCH 05/57] staging: r819xU_phy: Remove some local variables from the stack Lee Jones
2021-04-14 18:10 ` [PATCH 06/57] staging: r819xU_cmdpkt: Remove functionless method 'cmpk_handle_query_config_rx' Lee Jones
2021-04-14 18:10 ` Lee Jones [this message]
2021-04-14 18:10 ` [PATCH 08/57] staging: rtw_ioctl_set: Move 'channel_table' to the only place it's used Lee Jones
2021-04-14 18:10 ` [PATCH 09/57] staging: rtl8188eu: core: rtw_ieee80211: Fix incorrectly documented function Lee Jones
2021-04-14 18:10 ` [PATCH 10/57] staging: rtl8723bs: core: rtw_mlme: Remove a bunch of unused variables Lee Jones
2021-04-14 18:10 ` [PATCH 11/57] staging: rtl8723bs: core: rtw_mlme_ext: Deal with " Lee Jones
2021-04-14 18:10 ` [PATCH 12/57] staging: rtl8712: rtl871x_mp_ioctl: Remove a bunch of unused tables Lee Jones
2021-04-14 18:10 ` [PATCH 13/57] staging: rtl8723bs: core: rtw_recv: Mark debug variable as __maybe_unused Lee Jones
2021-04-14 18:10 ` [PATCH 14/57] staging: rtl8188eu: core: rtw_security: Fix some formatting and misdocumentation Lee Jones
2021-04-14 18:10 ` [PATCH 15/57] staging: rtl8723bs: core: rtw_security: Demote non-conformant kernel-doc header Lee Jones
2021-04-15 8:09 ` Fabio Aiuto
2021-04-15 8:31 ` Lee Jones
2021-04-15 8:38 ` Fabio Aiuto
2021-04-14 18:10 ` [PATCH 16/57] staging: rtl8723bs: core: rtw_sta_mgt: Remove unused variable 'psta' Lee Jones
2021-04-14 18:10 ` [PATCH 17/57] staging: rtl8723bs: core: rtw_sta_mgt: Return error value directly Lee Jones
2021-04-14 18:10 ` [PATCH 18/57] staging: octeon: ethernet-tx: Fix formatting issue in function header Lee Jones
2021-04-14 18:10 ` [PATCH 19/57] staging: rtl8723bs: core: rtw_wlan_util: Remove unused variable 'start_seq' Lee Jones
2021-04-14 18:10 ` [PATCH 20/57] staging: rtl8712: rtl871x_mp_ioctl: Move a large data struct onto the heap Lee Jones
2021-04-14 18:10 ` [PATCH 21/57] staging: iio: frequency: ad9834: Provide missing description for 'devid' Lee Jones
2021-04-16 17:29 ` Jonathan Cameron
2021-04-14 18:10 ` [PATCH 22/57] staging: nvec: Fix a bunch of kernel-doc issues Lee Jones
2021-04-14 18:10 ` [PATCH 23/57] staging: ks7010: ks_hostif: Remove a bunch of unused variables Lee Jones
2021-04-14 18:10 ` [PATCH 24/57] staging: fwserial: Demote a whole host of kernel-doc abuses Lee Jones
2021-04-14 18:10 ` [PATCH 25/57] staging: sm750fb: sm750_accel: Provide description for 'accel' and fix function naming Lee Jones
2021-04-14 18:10 ` [PATCH 26/57] staging: most: net: Fix some kernel-doc formatting issues Lee Jones
2021-04-14 18:10 ` [PATCH 27/57] staging: vt6655: upc: Suppress set but not used warning in macro Lee Jones
2021-04-14 18:11 ` [PATCH 28/57] staging: rtl8192u: ieee80211_softmac: Move a large data struct onto the heap Lee Jones
2021-04-14 18:11 ` [PATCH 29/57] staging: most: dim2: Provide missing descriptions and fix doc-rot Lee Jones
2021-04-14 18:11 ` [PATCH 30/57] staging: rtl8723bs: core: rtw_ieee80211: Remove seemingly pointless copy Lee Jones
2021-04-14 18:11 ` [PATCH 31/57] staging: rtl8723bs: core: rtw_mlme: 'retry' is only used if REJOIN is set Lee Jones
2021-04-14 18:11 ` [PATCH 32/57] staging: rtl8723bs: core: rtw_mlme_ext: 'evt_seq' is only used if CHECK_EVENT_SEQ " Lee Jones
2021-04-14 18:11 ` [PATCH 33/57] staging: most: i2c: Fix a little doc-rot Lee Jones
2021-04-14 18:11 ` [PATCH 34/57] staging: most: dim2: hal: Fix one kernel-doc header and demote two non-conforming ones Lee Jones
2021-04-14 18:11 ` [PATCH 35/57] staging: most: dim2: hal: Demote non-conformant kernel-doc headers Lee Jones
2021-04-14 18:11 ` [PATCH 36/57] staging: axis-fifo: axis-fifo: Fix some formatting issues Lee Jones
2021-04-14 18:11 ` [PATCH 37/57] staging: rtl8188eu: os_dep: ioctl_linux: Move 2 large data buffers into the heap Lee Jones
2021-04-15 5:20 ` Dan Carpenter
2021-04-15 5:25 ` Dan Carpenter
2021-04-19 14:05 ` Arnd Bergmann
2021-04-15 5:53 ` Dan Carpenter
2021-04-15 8:32 ` Lee Jones
2021-04-14 18:11 ` [PATCH 38/57] staging: fbtft: fb_ili9320: Remove unused variable 'ret' Lee Jones
2021-04-14 18:11 ` [PATCH 39/57] staging: rtl8723bs: core: rtw_ieee80211: Fix incorrectly named function Lee Jones
2021-04-14 18:11 ` [PATCH 40/57] staging: rtl8723bs: hal: odm_NoiseMonitor: Remove unused variable and dead code Lee Jones
2021-04-14 18:11 ` [PATCH 41/57] staging: rtl8188eu: os_dep: mon: Demote non-conforming kernel-doc headers Lee Jones
2021-04-14 18:11 ` [PATCH 42/57] staging: rtl8188eu: os_dep: rtw_android: Demote kernel-doc abuse Lee Jones
2021-04-14 18:11 ` [PATCH 43/57] staging: rtl8723bs: hal: rtl8723b_hal_init: Remove unused variable and dead code Lee Jones
2021-04-14 18:11 ` [PATCH 44/57] staging: rtl8723bs: hal: rtl8723b_phycfg: Fix a bunch of misnamed functions Lee Jones
2021-04-14 18:11 ` [PATCH 45/57] staging: rtl8723bs: hal: sdio_halinit: 'start' is only used if debug is enabled Lee Jones
2021-04-14 18:11 ` [PATCH 46/57] staging: rtl8723bs: hal: sdio_ops: Mark used 'err' as __maybe_unused and remove another Lee Jones
2021-04-14 18:11 ` [PATCH 47/57] staging: rtl8723bs: os_dep: ioctl_cfg80211: 'ack' is used when debug is enabled Lee Jones
2021-04-14 18:11 ` [PATCH 48/57] staging: comedi: drivers: jr3_pci: Remove set but unused variable 'min_full_scale' Lee Jones
2021-04-15 9:33 ` Ian Abbott
2021-04-15 9:52 ` Lee Jones
2021-04-14 18:11 ` [PATCH 49/57] staging: comedi: drivers: ni_tio: Fix slightly broken kernel-doc and demote others Lee Jones
2021-04-14 18:11 ` [PATCH 50/57] staging: comedi: drivers: ni_routes: Demote non-conforming kernel-doc headers Lee Jones
2021-04-14 18:11 ` [PATCH 51/57] staging: axis-fifo: axis-fifo: Fix function naming in the documentation Lee Jones
2021-04-14 18:11 ` [PATCH 52/57] staging: rtl8723bs: hal: odm_NoiseMonitor: Remove unused variable 'func_start' Lee Jones
2021-04-14 18:11 ` [PATCH 53/57] staging: rtl8723bs: core: rtw_mlme_ext: Move very large data buffer onto the heap Lee Jones
2021-04-14 18:11 ` [PATCH 54/57] staging: rtl8723bs: hal: rtl8723b_hal_init: Mark a bunch of debug variables as __maybe_unused Lee Jones
2021-04-14 18:11 ` [PATCH 55/57] staging: comedi: drivers: ni_mio_common: Move 'range_ni_E_ao_ext' to where it is used Lee Jones
2021-04-15 6:55 ` Uwe Kleine-König
2021-04-15 8:34 ` Lee Jones
2021-04-15 9:39 ` Ian Abbott
2021-04-15 9:54 ` Lee Jones
2021-04-14 18:11 ` [PATCH 56/57] staging: comedi: drivers: comedi_isadma: Fix misspelling of 'dma_chan1' Lee Jones
2021-04-14 18:11 ` [PATCH 57/57] staging: rtl8723bs: hal: sdio_halinit: Remove unused variable 'ret' Lee Jones
2021-04-15 9:16 ` Fabio Aiuto
2021-04-15 9:53 ` Lee Jones
2021-04-16 7:27 ` [PATCH 00/57] Rid W=1 warnings from Staging Fabio Aiuto
2021-04-16 7:31 ` Greg Kroah-Hartman
2021-04-27 9:31 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210414181129.1628598-8-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=sylphrenadin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).