]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: convert rtw_os_xmit_resource_alloc to return errno
authorHungyu Lin <dennylin0707@gmail.com>
Wed, 8 Apr 2026 11:13:13 +0000 (11:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 11:01:53 +0000 (05:01 -0600)
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>
drivers/staging/rtl8723bs/core/rtw_xmit.c

index 249947a7d91054e16b6a8b647a1c9eb712b4f4ad..fedfc968057b902883b1575002e862bb53e9c146 100644 (file)
@@ -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;