* [PATCH] staging: r8723au: Add missing initialization of change_inx in sort algorithm
@ 2014-04-10 17:46 Geert Uytterhoeven
2014-04-10 18:01 ` Larry Finger
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2014-04-10 17:46 UTC (permalink / raw)
To: Greg Kroah-Hartman, Larry Finger; +Cc: devel, linux-kernel, Geert Uytterhoeven
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>
---
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++) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: r8723au: Add missing initialization of change_inx in sort algorithm
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
2014-04-10 18:05 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Larry Finger @ 2014-04-10 18:01 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Kroah-Hartman; +Cc: devel, LKML, Jes Sorensen
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++) {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: r8723au: Add missing initialization of change_inx in sort algorithm
2014-04-10 18:01 ` Larry Finger
@ 2014-04-10 18:05 ` Geert Uytterhoeven
0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2014-04-10 18:05 UTC (permalink / raw)
To: Larry Finger; +Cc: Greg Kroah-Hartman, driverdevel, LKML, Jes Sorensen
Hi Larry,
On Thu, Apr 10, 2014 at 8:01 PM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> 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.
Because it's too new?
Several warnings were disabled in more recent versions of gcc (still
using 4.1.2 for m68k here ;-) due to too many false positives.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-10 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-04-10 18:05 ` Geert Uytterhoeven
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.