summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>2015-04-01 00:24:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-03 15:29:30 +0200
commitf7567e20708ed4129ccec1a21c4c55b9725b66d0 (patch)
tree2e3b99dda19c50f432243ddcaeeb7d655ef81d81 /drivers/staging
parente8f05b0b01ea1593c8cc6311704c227fb0d08b04 (diff)
staging: rtl8192e: Decrease nesting of rtllib_rx_auth_resp()
Return from rtllib_rx_auth_resp() if auth_parse() fails. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac.c89
1 files changed, 45 insertions, 44 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 9266bc647bc4..9a4179cb926c 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -2322,57 +2322,58 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb)
bool bSupportNmode = true, bHalfSupportNmode = false;
errcode = auth_parse(skb, &challenge, &chlen);
- if (0 == errcode) {
- if (ieee->open_wep || !challenge) {
- ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED;
- ieee->softmac_stats.rx_auth_rs_ok++;
- if (!(ieee->pHTInfo->IOTAction &
- HT_IOT_ACT_PURE_N_MODE)) {
- if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
- if (IsHTHalfNmodeAPs(ieee)) {
- bSupportNmode = true;
- bHalfSupportNmode = true;
- } else {
- bSupportNmode = false;
- bHalfSupportNmode = false;
- }
- }
- }
- /* Dummy wirless mode setting to avoid
- * encryption issue */
- if (bSupportNmode) {
- ieee->SetWirelessMode(ieee->dev,
- ieee->current_network.mode);
- } else {
- /*TODO*/
- ieee->SetWirelessMode(ieee->dev,
- IEEE_G);
- }
- if (ieee->current_network.mode ==
- IEEE_N_24G && bHalfSupportNmode) {
- netdev_info(ieee->dev,
- "======>enter half N mode\n");
- ieee->bHalfWirelessN24GMode =
- true;
- } else
- ieee->bHalfWirelessN24GMode =
- false;
-
- rtllib_associate_step2(ieee);
- } else {
- rtllib_auth_challenge(ieee, challenge,
- chlen);
- }
- } else {
+ if (errcode) {
ieee->softmac_stats.rx_auth_rs_err++;
RTLLIB_DEBUG_MGMT("Authentication respose status code 0x%x",
errcode);
netdev_info(ieee->dev,
- "Authentication respose status code 0x%x",
- errcode);
+ "Authentication respose status code 0x%x", errcode);
rtllib_associate_abort(ieee);
+ return;
+ }
+
+ if (ieee->open_wep || !challenge) {
+ ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED;
+ ieee->softmac_stats.rx_auth_rs_ok++;
+ if (!(ieee->pHTInfo->IOTAction &
+ HT_IOT_ACT_PURE_N_MODE)) {
+ if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
+ if (IsHTHalfNmodeAPs(ieee)) {
+ bSupportNmode = true;
+ bHalfSupportNmode = true;
+ } else {
+ bSupportNmode = false;
+ bHalfSupportNmode = false;
+ }
+ }
+ }
+ /* Dummy wirless mode setting to avoid
+ * encryption issue */
+ if (bSupportNmode) {
+ ieee->SetWirelessMode(ieee->dev,
+ ieee->current_network.mode);
+ } else {
+ /*TODO*/
+ ieee->SetWirelessMode(ieee->dev,
+ IEEE_G);
+ }
+
+ if (ieee->current_network.mode ==
+ IEEE_N_24G && bHalfSupportNmode) {
+ netdev_info(ieee->dev,
+ "======>enter half N mode\n");
+ ieee->bHalfWirelessN24GMode =
+ true;
+ } else
+ ieee->bHalfWirelessN24GMode =
+ false;
+
+ rtllib_associate_step2(ieee);
+ } else {
+ rtllib_auth_challenge(ieee, challenge,
+ chlen);
}
}