[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2026012050-reverb-recess-753a@gregkh>
Date: Tue, 20 Jan 2026 15:03:17 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Minu Jin <s9430939@...er.com>
Cc: andriy.shevchenko@...ux.intel.com, abrahamadekunle50@...il.com,
dan.carpenter@...aro.org, milospuric856@...il.com,
zxcv2569763104@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: rtl8723bs: fix unchecked return value of
skb_copy_bits
On Tue, Jan 20, 2026 at 10:22:41PM +0900, Minu Jin wrote:
> The function _rtw_pktfile_read() incorrectly updated the file pointer
> even when skb_copy_bits() failed.
>
> This patch fixes the issue by:
>
> 1. Propagating the negative error code from skb_copy_bits() if it fails,
> preventing internal pointer updates.
>
> 2. Updating all callers to check the return value and handle errors
> appropriately.
>
> Signed-off-by: Minu Jin <s9430939@...er.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 25 +++++++++++++++----
> .../staging/rtl8723bs/include/xmit_osdep.h | 2 +-
> drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 12 ++++++---
> 3 files changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index 21690857fd62..135bc5432be6 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -603,11 +603,13 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
> s32 UserPriority = 0;
>
> _rtw_open_pktfile(ppktfile->pkt, ppktfile);
> - _rtw_pktfile_read(ppktfile, (unsigned char *)ðerhdr, ETH_HLEN);
> + if (_rtw_pktfile_read(ppktfile, (unsigned char *)ðerhdr, ETH_HLEN) < 0)
> + return;
No error being returned? Why not?
thanks,
greg k-h
Powered by blists - more mailing lists