Commit dd99fe1f authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: simplify error handling for missing station



Simplify the code to handle the case where we're associated to a station
that is not in our list of known stations.

We can simply exit in this case. This patch reverts the if-condition and
saves one level of indentation.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221126160129.178697-10-martin@kaiser.cx


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa205589
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -597,11 +597,12 @@ static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)

	if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
		psta = rtw_get_stainfo(pstapriv, mgmt->sa);
		if (psta) {
		if (!psta)
			return;

		ret = rtw_check_bcn_info(padapter, pframe, len);
		if (!ret) {
				receive_disconnect(padapter,
						   pmlmeinfo->network.MacAddress, 0);
			receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0);
			return;
		}
		/* update WMM, ERP in the beacon */
@@ -609,7 +610,6 @@ static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
		if ((sta_rx_pkts(psta) & 0xf) == 0)
			update_beacon_info(padapter, ie_ptr, ie_len, psta);
		process_p2p_ps_ie(padapter, ie_ptr, ie_len);
		}
	} else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
		psta = rtw_get_stainfo(pstapriv, mgmt->sa);
		if (psta) {