The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, LKML <linux-kernel@vger.kernel.org>,
	Jes Sorensen <Jes.Sorensen@redhat.com>
Subject: Re: [PATCH] staging: r8723au: Add missing initialization of change_inx in sort algorithm
Date: Thu, 10 Apr 2014 13:01:24 -0500	[thread overview]
Message-ID: <5346DC74.8080701@lwfinger.net> (raw)
In-Reply-To: <1397152016-31005-1-git-send-email-geert@linux-m68k.org>

On 04/10/2014 12:46 PM, Geert Uytterhoeven wrote:
> drivers/staging/rtl8723au/core/rtw_wlan_util.c: In function ‘WMMOnAssocRsp23a’:
> drivers/staging/rtl8723au/core/rtw_wlan_util.c:684: warning: ‘change_inx’ may be used uninitialized in this function
>
> Depending on the uninitialized data on the stack, the array may not be
> sorted correctly.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Geert,

Thanks for this. I wonder why my gcc on x86_64 did not flag this problem.

Larry

>   drivers/staging/rtl8723au/core/rtw_wlan_util.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
> index 0dfcfbce3b52..a4361bb93865 100644
> --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
> +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
> @@ -681,7 +681,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter)
>   	inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
>
>   	if (pregpriv->wifi_spec == 1) {
> -		u32	j, tmp, change_inx;
> +		u32	j, tmp, change_inx = false;
>
>   		/* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */
>   		for (i = 0; i < 4; i++) {
>


  reply	other threads:[~2014-04-10 18:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 17:46 [PATCH] staging: r8723au: Add missing initialization of change_inx in sort algorithm Geert Uytterhoeven
2014-04-10 18:01 ` Larry Finger [this message]
2014-04-10 18:05   ` Geert Uytterhoeven

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=5346DC74.8080701@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=Jes.Sorensen@redhat.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox