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

Commit 3d665e66 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: Fix protection against connections during reset" into msm-4.9

parents 6c5f04f5 0e2f6e3f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -519,16 +519,16 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
		assoc_resp_ielen = 0;
	}

	mutex_lock(&wil->mutex);
	if (test_bit(wil_status_resetting, wil->status) ||
	    !test_bit(wil_status_fwready, wil->status)) {
		wil_err(wil, "status_resetting, cancel connect event, CID %d\n",
			evt->cid);
		mutex_unlock(&wil->mutex);
		/* no need for cleanup, wil_reset will do that */
		return;
	}

	mutex_lock(&wil->mutex);

	if ((wdev->iftype == NL80211_IFTYPE_STATION) ||
	    (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) {
		if (!test_bit(wil_status_fwconnecting, wil->status)) {
@@ -632,6 +632,13 @@ static void wmi_evt_disconnect(struct wil6210_priv *wil, int id,

	wil->sinfo_gen++;

	if (test_bit(wil_status_resetting, wil->status) ||
	    !test_bit(wil_status_fwready, wil->status)) {
		wil_err(wil, "status_resetting, cancel disconnect event\n");
		/* no need for cleanup, wil_reset will do that */
		return;
	}

	mutex_lock(&wil->mutex);
	wil6210_disconnect(wil, evt->bssid, reason_code, true);
	mutex_unlock(&wil->mutex);