Re: [PATCH] staging: rtl8723bs: handle key setup failures

From: Greg KH

Date: Tue Sep 01 2026 - 06:28:59 EST


On Sun, Aug 02, 2026 at 09:49:19PM -0300, Lucas Jeffrey wrote:
> The return values from key setup helpers were ignored in
> rtw_cfg80211_ap_set_encryption().
>
> Propagate failures from rtw_ap_set_wep_key(),
> rtw_ap_set_group_key(), and rtw_ap_set_pairwise_key() back to
> cfg80211 instead of continuing after an unsuccessful key setup.
>
> This avoids silently reporting success when the key setup command
> could not be queued or helper functions fail to allocate memory.
>
> Signed-off-by: Lucas Jeffrey <luquijeffrey@xxxxxxxxx>
> ---
> .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> index 967cd1b34aed..8e5aa036d5eb 100644
> --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
> @@ -563,7 +563,9 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
>
> psecuritypriv->dot11DefKeylen[wep_key_idx] = wep_key_len;
>
> - rtw_ap_set_wep_key(padapter, param->u.crypt.key, wep_key_len, wep_key_idx, 1);
> + if (rtw_ap_set_wep_key(padapter, param->u.crypt.key, wep_key_len, wep_key_idx, 1) == _FAIL)
> + ret = -EIO;
> +

Why the extra blank line?

thanks,

greg k-h