Re: [PATCH 37/57] staging: rtl8188eu: os_dep: ioctl_linux: Move 2 large data buffers into the heap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 14, 2021 at 07:11:09PM +0100, Lee Jones wrote:
> ---
>  drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
> index c95ae4d6a3b6b..cc14f00947781 100644
> --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
> @@ -224,7 +224,7 @@ static char *translate_scan(struct adapter *padapter,
>  	/* parsing WPA/WPA2 IE */
>  	{
>  		u8 *buf;
> -		u8 wpa_ie[255], rsn_ie[255];
> +		u8 *wpa_ie, *rsn_ie;
>  		u16 wpa_len = 0, rsn_len = 0;
>  		u8 *p;
>  
> @@ -232,6 +232,14 @@ static char *translate_scan(struct adapter *padapter,
>  		if (!buf)
>  			return start;
>  
> +		wpa_ie = kzalloc(255, GFP_ATOMIC);
> +		if (!wpa_ie)
> +			return start;

kfree(buf);

> +
> +		rsn_ie = kzalloc(255, GFP_ATOMIC);
> +		if (!rsn_ie)
> +			return start;

kfree(buf);
kfree(wpa_ie);

> +
>  		rtw_get_sec_ie(pnetwork->network.ies, pnetwork->network.ie_length, rsn_ie, &rsn_len, wpa_ie, &wpa_len);
>  		RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.ssid.ssid));
>  		RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));

regards,
dan carpenter




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux