Messages in this thread | | | Date | Mon, 27 Jul 2020 14:44:51 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode |
| |
On Fri, Jul 24, 2020 at 08:29:55PM +0800, Dinghao Liu wrote: > The variable authmode will keep uninitialized if neither if > statements used to initialize this variable are not triggered. > Then authmode may contain a garbage value and influence the > execution flow of this function. > > Fix this by initializing it to zero. > > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
This matches how rtl8723bs does it.
Fixes: 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4") Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
There is a quirk/bug in GCC where it's initializing stuff to zero sometimes instead of printing a compile warning so this probably doesn't change run time very much.
regards, dan carpenter
| |