summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712
diff options
context:
space:
mode:
authorAli Bahar <ali@internetdog.org>2011-09-04 03:14:15 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 17:00:33 -0700
commitc13b6f24986de17b29a56be7b6b851d565f455fa (patch)
treed9fcd3929b5963811724bbd1f8e0f617550c191d /drivers/staging/rtl8712
parent6c19d86b9bd03d32d727d0b1d56a0716dfe6eb83 (diff)
downloadlinux-c13b6f24986de17b29a56be7b6b851d565f455fa.tar.bz2
staging: r8712u: Merging Realtek's latest (v2.6.6). Use stack, not malloc.
translate_scan() now uses the stack for some variables, instead of mallocing. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_linux.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index ec58b6636fac..45225530c350 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -169,10 +169,6 @@ static inline char *translate_scan(struct _adapter *padapter,
struct iw_event iwe;
struct ieee80211_ht_cap *pht_capie;
char *current_val;
- u8 *buf = (u8 *)_malloc(pnetwork->network.IELength * 2);
- u8 *wpa_ie = (u8 *)_malloc(255);
- u8 *rsn_ie = (u8 *)_malloc(255);
- u8 *wps_ie = (u8 *)_malloc(MAX_WPS_IE_LEN);
s8 *p;
u32 i = 0, ht_ielen = 0;
u16 cap, ht_cap = false, mcs_rate;
@@ -289,6 +285,8 @@ static inline char *translate_scan(struct _adapter *padapter,
start = current_val;
/* parsing WPA/WPA2 IE */
{
+ u8 buf[MAX_WPA_IE_LEN];
+ u8 wpa_ie[255], rsn_ie[255];
u16 wpa_len = 0, rsn_len = 0;
int n;
sint out_len = 0;
@@ -339,6 +337,7 @@ static inline char *translate_scan(struct _adapter *padapter,
}
{ /* parsing WPS IE */
+ u8 wps_ie[512];
uint wps_ielen;
if (r8712_get_wps_ie(pnetwork->network.IEs,
@@ -363,10 +362,6 @@ static inline char *translate_scan(struct _adapter *padapter,
iwe.u.qual.noise = 0; /* noise level */
start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_QUAL_LEN);
/* how to translate rssi to ?% */
- kfree(buf);
- kfree(wpa_ie);
- kfree(rsn_ie);
- kfree(wps_ie);
return start;
}