All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yuanjun Gong <ruc_gongyuanjun@163.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/1] staging: fix a potential infinite loop
Date: Tue, 17 May 2022 12:06:57 +0200	[thread overview]
Message-ID: <YoNzwe9BodtxAH1N@kroah.com> (raw)
In-Reply-To: <20220517095809.7791-1-ruc_gongyuanjun@163.com>

On Tue, May 17, 2022 at 05:58:09PM +0800, Yuanjun Gong wrote:
> From: Gong Yuanjun <ruc_gongyuanjun@163.com>
> 
> In the for-loop in _rtl92e_update_rxcounts(),
> i is a u8 counter while priv->rtllib->LinkDetectInfo.SlotNum is
> a u16 num, there is a potential infinite loop if SlotNum is larger
> than u8_max.
> 
> Change the u8 loop counter i into u16.
> 
> Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@163.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> index b9ce71848023..3c5082abc583 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> @@ -1342,7 +1342,7 @@ static void _rtl92e_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum,
>  				    u32 *TotalRxDataNum)
>  {
>  	u16	SlotIndex;
> -	u8	i;
> +	u16	i;
>  
>  	*TotalRxBcnNum = 0;
>  	*TotalRxDataNum = 0;
> -- 
> 2.17.1
> 

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

      parent reply	other threads:[~2022-05-17 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17  9:58 [PATCH 1/1] staging: fix a potential infinite loop Yuanjun Gong
2022-05-17 10:06 ` Greg KH
2022-05-17 10:06 ` Greg KH [this message]

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=YoNzwe9BodtxAH1N@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruc_gongyuanjun@163.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.