Commit af019910 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: use is_zero_ether_addr() instead of memcmp()



Use is_zero_ether_addr() instead of memcmp to check
if the ethernet address is all zeros.

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230804083841.1321554-1-yangyingliang@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e21a9d2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -226,9 +226,8 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr)
{
	struct list_head	*phead, *plist;
	struct	wlan_network *pnetwork = NULL;
	u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};

	if (!memcmp(zero_addr, addr, ETH_ALEN)) {
	if (is_zero_ether_addr(addr)) {
		pnetwork = NULL;
		goto exit;
	}
+6 −6
Original line number Diff line number Diff line
@@ -670,8 +670,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
			goto exit;
		}

		if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
		   !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
		if (is_zero_ether_addr(pattrib->bssid) ||
		    is_zero_ether_addr(mybssid) ||
		    (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
			ret = _FAIL;
			goto exit;
@@ -762,8 +762,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p


		/*  check BSSID */
		if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
		     !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
		if (is_zero_ether_addr(pattrib->bssid) ||
		    is_zero_ether_addr(mybssid) ||
		    (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {

			if (!bmcast)
+1 −2
Original line number Diff line number Diff line
@@ -1850,9 +1850,8 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
	u8 index, blInserted = false;
	struct adapter *padapter = rtw_netdev_priv(ndev);
	struct security_priv *psecuritypriv = &padapter->securitypriv;
	u8 strZeroMacAddress[ETH_ALEN] = { 0x00 };

	if (!memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN))
	if (is_zero_ether_addr((u8 *)pmksa->bssid))
		return -EINVAL;

	blInserted = false;