From: Hungyu Lin Date: Wed, 8 Apr 2026 11:13:13 +0000 (+0000) Subject: staging: rtl8723bs: convert rtw_os_xmit_resource_alloc to return errno X-Git-Tag: v7.2-rc1~66^2~177 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=f5be742ee90dbbd3f6ed196ad42b5fae4e0d096c;p=thirdparty%2Flinux.git 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 Reviewed-by: Dan Carpenter Link: https://patch.msgid.link/20260408111314.19329-6-dennylin0707@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 249947a7d9105..fedfc968057b9 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;