public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Minu Jin <s9430939@naver.com>
Cc: gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
	abrahamadekunle50@gmail.com, zxcv2569763104@gmail.com,
	milospuric856@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: fix unchecked return value of skb_copy_bits
Date: Tue, 20 Jan 2026 10:06:15 +0300	[thread overview]
Message-ID: <aW8pZ51ia400yFW3@stanley.mountain> (raw)
In-Reply-To: <20260120025051.2843461-1-s9430939@naver.com>

On Tue, Jan 20, 2026 at 11:50:51AM +0900, Minu Jin wrote:
> diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
> index 944b9c724b32..0720aa7cad62 100644
> --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
> @@ -28,8 +28,10 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
>  	len =  rtw_remainder_len(pfile);
>  	len = (rlen > len) ? len : rlen;
>  
> -	if (rmem)
> -		skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len);
> +	if (rmem) {
> +		if (skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len) != 0)
> +			return 0;

Zero normally means success.  Propagate the negative error code from
skb_copy_bits().

	ret = skb_copy_bits();
	if (ret)
		return ret;

I understand that this driver already does a lot of crazy stuff, but
it's not a model to follow when we're writing new code.

regards,
dan carpenter


  reply	other threads:[~2026-01-20  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20  2:50 [PATCH] staging: rtl8723bs: fix unchecked return value of skb_copy_bits Minu Jin
2026-01-20  7:06 ` Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-20 12:59 Minu Jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aW8pZ51ia400yFW3@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=abrahamadekunle50@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=milospuric856@gmail.com \
    --cc=s9430939@naver.com \
    --cc=zxcv2569763104@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox