Commit e427bdd8 authored by Fabio Aiuto's avatar Fabio Aiuto Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: rewrite comparison to null



fi following post-commit checkpatch issues:

CHECK: Comparison to NULL could be written "!p"
290: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:978:
+			if (p == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
328: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2016:
+	if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
361: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2378:
+	if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
391: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3478:
+	if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!p"
427: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4071:
+	if (p == NULL)
--
CHECK: Comparison to NULL could be written "!BIP_AAD"
781: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1690:
+	if (BIP_AAD == NULL)
--
CHECK: Comparison to NULL could be written "!pwep"
1773: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3062:
+			if (pwep == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_beacon_ie"
1784: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3510:
+		if (pmlmepriv->wps_beacon_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_probe_resp_ie"
1795: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3544:
+		if (pmlmepriv->wps_probe_resp_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_assoc_resp_ie"
1807: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3574:
+		if (pmlmepriv->wps_assoc_resp_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pbuf"
1818: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3928:
+	if (pbuf == NULL)
--
CHECK: Comparison to NULL could be written "!if1"
1944: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:392:
+	if (if1 == NULL)

CHECK: Using comparison to false is error prone
402: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3890:
+	if (false == bxmitok)
--
CHECK: Using comparison to true is error prone
671: FILE: drivers/staging/rtl8723bs/core/rtw_recv.c:365:
+				if ((prxattrib->bdecrypted == true) && (brpt_micerror == true))
--
CHECK: Using comparison to true is error prone
1051: FILE: drivers/staging/rtl8723bs/core/rtw_xmit.c:1174:
+	if (padapter->securitypriv.binstallBIPkey != true)
--
CHECK: Using comparison to false is error prone
1632: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2194:
+	if (false == bMatched)

Signed-off-by: default avatarFabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/572f96dcb6217fd3e6ea23c37b55b0ebb3231f14.1617802415.git.fabioaiuto83@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6e7ad69
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -975,7 +975,7 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram
			p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len,
			p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len,
				pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);
				pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);


			if (p == NULL)
			if (!p)
				goto authclnt_fail;
				goto authclnt_fail;


			memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
			memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
@@ -2013,7 +2013,7 @@ static struct xmit_frame *_alloc_mgtxmitframe(struct xmit_priv *pxmitpriv, bool
	else
	else
		pmgntframe = rtw_alloc_xmitframe_ext(pxmitpriv);
		pmgntframe = rtw_alloc_xmitframe_ext(pxmitpriv);


	if (pmgntframe == NULL)
	if (!pmgntframe)
		goto exit;
		goto exit;


	pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
	pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
@@ -2375,7 +2375,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
		return;
		return;


	pmgntframe = alloc_mgtxmitframe(pxmitpriv);
	pmgntframe = alloc_mgtxmitframe(pxmitpriv);
	if (pmgntframe == NULL)
	if (!pmgntframe)
		return;
		return;


	/* update attribute */
	/* update attribute */
@@ -3475,7 +3475,7 @@ void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsig
	__le16 le_tmp;
	__le16 le_tmp;


	pmgntframe = alloc_mgtxmitframe(pxmitpriv);
	pmgntframe = alloc_mgtxmitframe(pxmitpriv);
	if (pmgntframe == NULL)
	if (!pmgntframe)
		return;
		return;


	/* update attribute */
	/* update attribute */
@@ -3887,7 +3887,7 @@ unsigned int send_beacon(struct adapter *padapter)
	}
	}




	if (false == bxmitok)
	if (!bxmitok)
		return _FAIL;
		return _FAIL;
	else
	else
		return _SUCCESS;
		return _SUCCESS;
@@ -4068,7 +4068,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str


	/*  checking SSID */
	/*  checking SSID */
	p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset);
	p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset);
	if (p == NULL)
	if (!p)
		return _FAIL;
		return _FAIL;


	if (*(p + 1)) {
	if (*(p + 1)) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -362,7 +362,7 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
				if ((IS_MCAST(prxattrib->ra) == true)  && (prxattrib->key_index != pmlmeinfo->key_index))
				if ((IS_MCAST(prxattrib->ra) == true)  && (prxattrib->key_index != pmlmeinfo->key_index))
					brpt_micerror = false;
					brpt_micerror = false;


				if ((prxattrib->bdecrypted == true) && (brpt_micerror == true))
				if ((prxattrib->bdecrypted) && (brpt_micerror))
					rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra));
					rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra));


				res = _FAIL;
				res = _FAIL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1687,7 +1687,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
	ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE;
	ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE;
	BIP_AAD = rtw_zmalloc(ori_len);
	BIP_AAD = rtw_zmalloc(ori_len);


	if (BIP_AAD == NULL)
	if (!BIP_AAD)
		return _FAIL;
		return _FAIL;


	/* PKT start */
	/* PKT start */
+1 −1
Original line number Original line Diff line number Diff line
@@ -1171,7 +1171,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
		goto xmitframe_coalesce_success;
		goto xmitframe_coalesce_success;


	/* IGTK key is not install, it may not support 802.11w */
	/* IGTK key is not install, it may not support 802.11w */
	if (padapter->securitypriv.binstallBIPkey != true)
	if (!padapter->securitypriv.binstallBIPkey)
		goto xmitframe_coalesce_success;
		goto xmitframe_coalesce_success;


	/* station mode doesn't need TX BIP, just ready the code */
	/* station mode doesn't need TX BIP, just ready the code */
+1 −1
Original line number Original line Diff line number Diff line
@@ -2191,7 +2191,7 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy,
		}
		}
	}
	}


	if (false == bMatched)
	if (!bMatched)
		return -EINVAL;
		return -EINVAL;


	return 0;
	return 0;
Loading