int i;
struct xmit_buf *pxmitbuf;
struct xmit_frame *pxframe;
- signed int res = _SUCCESS;
+ int res;
spin_lock_init(&pxmitpriv->lock);
spin_lock_init(&pxmitpriv->lock_sctx);
if (!pxmitpriv->pallocated_frame_buf) {
pxmitpriv->pxmit_frame_buf = NULL;
- res = _FAIL;
- goto exit;
+ return _FAIL;
}
pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4);
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
- if (!pxmitpriv->pallocated_xmitbuf) {
- res = _FAIL;
- goto exit;
- }
+ if (!pxmitpriv->pallocated_xmitbuf)
+ return _FAIL;
pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmitbuf), 4);
fsleep(10 * USEC_PER_MSEC);
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true);
if (res == _FAIL)
- goto exit;
+ return _FAIL;
}
pxmitbuf->phead = pxmitbuf->pbuf;
if (!pxmitpriv->xframe_ext_alloc_addr) {
pxmitpriv->xframe_ext = NULL;
- res = _FAIL;
- goto exit;
+ return _FAIL;
}
pxmitpriv->xframe_ext = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->xframe_ext_alloc_addr), 4);
pxframe = (struct xmit_frame *)pxmitpriv->xframe_ext;
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
- if (!pxmitpriv->pallocated_xmit_extbuf) {
- res = _FAIL;
- goto exit;
- }
+ if (!pxmitpriv->pallocated_xmit_extbuf)
+ return _FAIL;
pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4);
pxmitbuf->buf_tag = XMITBUF_MGNT;
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true);
- if (res == _FAIL) {
- res = _FAIL;
- goto exit;
- }
+ if (res == _FAIL)
+ return _FAIL;
pxmitbuf->phead = pxmitbuf->pbuf;
pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ;
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf,
MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ,
true);
- if (res == _FAIL) {
- res = _FAIL;
- goto exit;
- }
+ if (res == _FAIL)
+ return _FAIL;
pxmitbuf->phead = pxmitbuf->pbuf;
pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ;
res = rtw_alloc_hwxmits(padapter);
if (res == _FAIL)
- goto exit;
+ return _FAIL;
rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
for (i = 0; i < 4; i++)
rtw_hal_init_xmit_priv(padapter);
-exit:
- return res;
+ return _SUCCESS;
}
void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)