On Tue, 29 Mar 2022 23:57:10 +0800, gregkh@xxxxxxxxxxxxxxxxxxx wrote: >> --- a/drivers/staging/r8188eu/core/rtw_xmit.c >> +++ b/drivers/staging/r8188eu/core/rtw_xmit.c >> @@ -180,6 +180,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) >> pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; >> >> rtw_alloc_hwxmits(padapter); >> + if (!pxmitpriv->hwxmits) { >> + res = _FAIL; >> + goto exit; >> + } > > You just leaked memory resources :( > Sorry, you are right. I tracked the callers of _rtw_init_xmit_priv() and found that they do not properly release the resources allocated by this funciton. This means that the other error paths can also bring memory leaks, as well as the same function in drivers/staging/rtl8723bs/core/rtw_xmit.c. There are also several similar issuses of alloc_hwxmits() and _r8712_init_xmit_priv() in drivers/staging/rtl8712/rtl871x_xmit.c. I will try to carefully fix them. Regards, Xiaoke Wang