Re: [PATCH 3/4] staging: rtl8723bs: convert update_attrib_sec_info to return errno
From: Dan Carpenter
Date: Mon Jun 15 2026 - 03:42:48 EST
On Sun, Jun 14, 2026 at 06:23:08PM +0000, Hungyu Lin wrote:
> Convert update_attrib_sec_info() to return 0 on success and
> a negative errno on failure. Update update_attrib() to
> propagate the returned error code.
>
> No functional change intended.
>
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 7d10caf8cbfe..b6d9332958f5 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -519,7 +519,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
^^^
Change this to int. I wouldn't have commented on this except for the
change to update_attrib()...
> pattrib->encrypt = 0;
>
> if ((pattrib->ether_type != 0x888e) && !check_fwstate(pmlmepriv, WIFI_MP_STATE))
> - return _FAIL;
> + return -EINVAL;
> } else {
> GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
>
> @@ -558,7 +558,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> pattrib->icv_len = 4;
>
> if (psecuritypriv->busetkipkey == _FAIL)
> - return _FAIL;
> + return -EINVAL;
>
> if (bmcast)
> TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
> @@ -596,7 +596,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> else
> pattrib->bswenc = false;
>
> - return _SUCCESS;
> + return 0;
> }
>
> u8 qos_acm(u8 acm_mask, u8 priority)
> @@ -754,9 +754,10 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
> return _FAIL;
>
> spin_lock_bh(&psta->lock);
> - if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) {
> + ret = update_attrib_sec_info(padapter, pattrib, psta);
> + if (ret) {
> spin_unlock_bh(&psta->lock);
> - return _FAIL;
> + return ret;
This should have stayed as _FAIL and then been updated in the next
patch. It doesn't break anything, but lets still do it that way.
Let's never mix _FAIL and standard error codes.
regards,
dan carpenter