Skip to content

Commit

Permalink
rtlwifi: rtl8192de: Fix error exit from hw_init
Browse files Browse the repository at this point in the history
In routine rtl92de_hw_init(), there are two places where a failure is
not handled correctly.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Larry Finger authored and John W. Linville committed Jul 5, 2011
1 parent eb8b27a commit 45a7713
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/wireless/rtlwifi/rtl8192de/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,8 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
("Failed to download FW. Init HW "
"without FW..\n"));
err = 1;
rtlhal->fw_ready = false;
return 1;
} else {
rtlhal->fw_ready = true;
}
Expand Down Expand Up @@ -1044,6 +1044,11 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
if (((tmp_rega & BIT(11)) == BIT(11)))
break;
}
/* check that loop was successful. If not, exit now */
if (i == 10000) {
rtlpci->init_ready = false;
return 1;
}
}
}
rtlpci->init_ready = true;
Expand Down

0 comments on commit 45a7713

Please sign in to comment.