Re: [PATCH v3] staging: rtl8723bs: fix unchecked return value of skb_copy_bits

From: Andy Shevchenko

Date: Tue Jan 20 2026 - 11:17:16 EST


On Wed, Jan 21, 2026 at 12:50:34AM +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 (including set_qos) to check the return value
> and handle errors appropriately.

...

> -uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
> +int _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
> {
> - uint len = 0;
> + uint len = 0;

Use
unsigned int len;

(Note that the 0 assignment is redundant)


> + int ret;
>
> len = rtw_remainder_len(pfile);

^^^ len is assigned here.

--
With Best Regards,
Andy Shevchenko