mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
staging: rtl8723bs: convert _rtw_init_xmit_priv to return errno
Convert _rtw_init_xmit_priv() to return 0 on success and negative error codes on failure. Update the caller to check for non-zero return values. Signed-off-by: Hungyu Lin <dennylin0707@gmail.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Link: https://patch.msgid.link/20260408111314.19329-7-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f5be742ee9
commit
b4c71a9978
|
|
@ -128,7 +128,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
if (!pxmitpriv->pallocated_frame_buf) {
|
||||
pxmitpriv->pxmit_frame_buf = NULL;
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4);
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (!pxmitpriv->pallocated_xmitbuf)
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
|
||||
pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmitbuf), 4);
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
fsleep(10 * USEC_PER_MSEC);
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true);
|
||||
if (res)
|
||||
return _FAIL;
|
||||
return res;
|
||||
}
|
||||
|
||||
pxmitbuf->phead = pxmitbuf->pbuf;
|
||||
|
|
@ -212,7 +212,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
if (!pxmitpriv->xframe_ext_alloc_addr) {
|
||||
pxmitpriv->xframe_ext = NULL;
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
pxmitpriv->xframe_ext = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->xframe_ext_alloc_addr), 4);
|
||||
pxframe = (struct xmit_frame *)pxmitpriv->xframe_ext;
|
||||
|
|
@ -244,7 +244,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
|
||||
|
||||
if (!pxmitpriv->pallocated_xmit_extbuf)
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
|
||||
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4);
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true);
|
||||
if (res)
|
||||
return _FAIL;
|
||||
return res;
|
||||
|
||||
pxmitbuf->phead = pxmitbuf->pbuf;
|
||||
pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ;
|
||||
|
|
@ -289,7 +289,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ,
|
||||
true);
|
||||
if (res)
|
||||
return _FAIL;
|
||||
return res;
|
||||
|
||||
pxmitbuf->phead = pxmitbuf->pbuf;
|
||||
pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ;
|
||||
|
|
@ -301,7 +301,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
res = rtw_alloc_hwxmits(padapter);
|
||||
if (res)
|
||||
return _FAIL;
|
||||
return res;
|
||||
rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
@ -313,7 +313,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
rtw_hal_init_xmit_priv(padapter);
|
||||
|
||||
return _SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
||||
|
|
|
|||
|
|
@ -636,6 +636,8 @@ void rtw_reset_drv_sw(struct adapter *padapter)
|
|||
|
||||
u8 rtw_init_drv_sw(struct adapter *padapter)
|
||||
{
|
||||
int res;
|
||||
|
||||
rtw_init_default_value(padapter);
|
||||
|
||||
rtw_init_hal_com_default_value(padapter);
|
||||
|
|
@ -653,7 +655,8 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
|
|||
|
||||
init_mlme_ext_priv(padapter);
|
||||
|
||||
if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
|
||||
res = _rtw_init_xmit_priv(&padapter->xmitpriv, padapter);
|
||||
if (res)
|
||||
goto free_mlme_ext;
|
||||
|
||||
if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user