Commit d48037f9 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman
Browse files

staging: rtl8188eu: unneeded NULL check



before these NULL checks we are already checking it for NULL, and if
it is NULL then we are jumping to the error label and handling
the error before returning.
So we can reach this part of the code only if the variable is known
to be not NULL, and if we already know that it is not NULL, then no
need to check it again.

Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c78a964c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1025,7 +1025,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct

		/* adding icv, if necessary... */
		if (pattrib->iv_len) {
			if (psta != NULL) {
			switch (pattrib->encrypt) {
				case _WEP40_:
				case _WEP104_:
@@ -1044,7 +1043,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
						AES_IV(pattrib->iv, psta->dot11txpn, 0);
					break;
			}
			}

			memcpy(pframe, pattrib->iv, pattrib->iv_len);

+15 −15
Original line number Diff line number Diff line
@@ -155,6 +155,8 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
	bool fw_ps_awake = true;
	u8 hw_init_completed = false;
	struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
	struct mlme_priv *pmlmepriv = NULL;
	u8 bLinked = false;

	hw_init_completed = Adapter->hw_init_completed;

@@ -170,12 +172,11 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
		fw_ps_awake = false;

	/* ODM */
	if (hw_init_completed) {
		struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
		u8 bLinked = false;
	pmlmepriv = &Adapter->mlmepriv;

	if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) ||
		    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE))) {
	    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE |
			   WIFI_ADHOC_MASTER_STATE))) {
		if (Adapter->stapriv.asoc_sta_count > 2)
			bLinked = true;
	} else {/* Station mode */
@@ -185,7 +186,6 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)

	ODM_CmnInfoUpdate(&hal_data->odmpriv, ODM_CMNINFO_LINK, bLinked);
	ODM_DMWatchdog(&hal_data->odmpriv);
	}
skip_dm:
	/*  Check GPIO to determine current RF on/off and Pbc status. */
	/*  Check Hardware Radio ON/OFF or not */