Re: [PATCH] staging: rtl8723bs: use strscpy() for ifname copy
From: Greg Kroah-Hartman
Date: Tue Sep 01 2026 - 06:16:57 EST
On Wed, Aug 26, 2026 at 05:34:18PM +0300, Svyatoslav Nikolenko wrote:
> Replace snprintf() with strscpy() when copying ifname into registry_par
> to avoid unnecessary format specifier parsing.
>
> Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index f31196f54b3e..dd0c5fc813c8 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -256,7 +256,7 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
>
> registry_par->enable80211d = (u8)rtw_80211d;
>
> - snprintf(registry_par->ifname, 16, "%s", ifname);
> + strscpy(registry_par->ifname, ifname, sizeof(registry_par->ifname));
>
> registry_par->notch_filter = (u8)rtw_notch_filter;
the ifname module option, and field, should just be removed from this
driver entirely. Can you do that instead?
thanks,
greg k-h