Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45a77138 authored by Larry Finger's avatar Larry Finger Committed by John W. Linville
Browse files

rtlwifi: rtl8192de: Fix error exit from hw_init



In routine rtl92de_hw_init(), there are two places where a failure is
not handled correctly.

Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent eb8b27ad
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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;
	}
@@ -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;