Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: r8723au: Add missing initialization of change_inx in sort algorithm

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
2c33d7cc e6b1ea77

+1 -1
+1 -1
drivers/staging/rtl8723au/core/rtw_wlan_util.c
··· 681 681 inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; 682 682 683 683 if (pregpriv->wifi_spec == 1) { 684 - u32 j, tmp, change_inx; 684 + u32 j, tmp, change_inx = false; 685 685 686 686 /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */ 687 687 for (i = 0; i < 4; i++) {