lkml.org 
[lkml]   [2022]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/7] staging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv
On Mon, Apr 11, 2022 at 03:51:34PM +0530, Vihas Makwana wrote:
> -void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
> -{
> -
> - rtw_free_mlme_priv_ie_data(pmlmepriv);
> -
> - if (pmlmepriv) {
> - vfree(pmlmepriv->free_bss_buf);
> - }
> -
> -}
> -
> struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *free_queue) */
> {
> struct wlan_network *pnetwork;
> @@ -290,7 +279,11 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv)
>
> void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
> {
> - _rtw_free_mlme_priv(pmlmepriv);
> + rtw_free_mlme_priv_ie_data(pmlmepriv);
> +
> + if (pmlmepriv) {

Not related to your patch, but this check makes no sense. The
rtw_free_mlme_priv_ie_data() function dereference pmlmepriv
unconditionally so it would have already crashed.


> + vfree(pmlmepriv->free_bss_buf);
> + }
> }

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-04-11 12:34    [W:0.979 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site