diff options
| author | Hungyu Lin <dennylin0707@gmail.com> | 2026-04-08 11:13:13 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-27 05:01:53 -0600 |
| commit | f5be742ee90dbbd3f6ed196ad42b5fae4e0d096c (patch) | |
| tree | b63b04d6b099005e77110bf42b50fb87868f7eaf /drivers | |
| parent | e7c3d33739e1e0d3159916bd30826d1ee9bb9477 (diff) | |
| download | linux-f5be742ee90dbbd3f6ed196ad42b5fae4e0d096c.tar.gz linux-f5be742ee90dbbd3f6ed196ad42b5fae4e0d096c.zip | |
staging: rtl8723bs: convert rtw_os_xmit_resource_alloc to return errno
Convert rtw_os_xmit_resource_alloc() to return 0 on success
and -ENOMEM on failure. Update the callers 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-6-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_xmit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 249947a7d910..fedfc968057b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -78,12 +78,12 @@ static int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf if (alloc_sz > 0) { pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); if (!pxmitbuf->pallocated_buf) - return _FAIL; + return -ENOMEM; pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); } - return _SUCCESS; + return 0; } s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) @@ -179,10 +179,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) /* Tx buf allocation may fail sometimes, so sleep and retry. */ res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true); - if (res == _FAIL) { + if (res) { fsleep(10 * USEC_PER_MSEC); res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), true); - if (res == _FAIL) + if (res) return _FAIL; } @@ -258,7 +258,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitbuf->buf_tag = XMITBUF_MGNT; res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true); - if (res == _FAIL) + if (res) return _FAIL; pxmitbuf->phead = pxmitbuf->pbuf; @@ -288,7 +288,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ, true); - if (res == _FAIL) + if (res) return _FAIL; pxmitbuf->phead = pxmitbuf->pbuf; |
