Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

From: Dan Carpenter
Date: Mon Jul 27 2020 - 09:24:22 EST

I review things in the order that they appear in my inbox so I hadn't
seen Greg and Larry's comments. You've now stumbled into an area of
politics where you have conflicting reviews... :P Fortunately, we're
all of us reasonable people.

I think your patch is correct in that it is what the original coder
intended. You just need to sell the patch correctly in the commit
message. The real danger of the original code would be if "authmode" is
accidentally 0x30 or 0xdd just because it was uninitialized. Setting it
to zero ensures that it is not and it also matches how this is handled
in the rtl8723bs driver. This matches the original author's intention.


1) Re-write the commit message.

The variable authmode can be uninitialized. The danger would be
if it equals _WPA_IE_ID_ (0xdd) or _WPA2_IE_ID_ (0x33). We can
avoid this by setting it to zero instead. This is the approach that
was used in the rtl8723bs driver.

2) Add a fixes tag.
Fixes: 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4")

3) Change the commit to Larry's style with the "else if" and "else".
Sometimes people just disagree about style so it's easiest to go with
whatever the maintainer (Larry) wants. It's not worth debating one
way or the other so just redo it.

Then resend. Google for "how to send a v2 patch" to get the right

dan carpenter