From: Nikolay Kulikov <nikolayof23@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Nikolay Kulikov <nikolayof23@gmail.com>
Subject: [PATCH 1/2] staging: rtl8723bs: remove unused case from update_beacon()
Date: Mon, 1 Jun 2026 18:01:23 +0300 [thread overview]
Message-ID: <20260601150253.69930-2-nikolayof23@gmail.com> (raw)
In-Reply-To: <20260601150253.69930-1-nikolayof23@gmail.com>
The update_beacon() function is never called with 'ie_id' equal to
'WLAN_EID_VENDOR_SPECIFIC', meaning this case branch will never be
called, so remove it and several related functions.
Removing this case branch also fixes a possible null pointer
dereference in update_bcn_vendor_spec() if 'oui' is NULL, since
its value is not checked in any way.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_ap.c | 84 -------------------------
1 file changed, 84 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 065850a9e894..316f879923f5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1336,84 +1336,6 @@ static void update_bcn_rsn_ie(struct adapter *padapter)
{
}
-static void update_bcn_wpa_ie(struct adapter *padapter)
-{
-}
-
-static void update_bcn_wmm_ie(struct adapter *padapter)
-{
-}
-
-static void update_bcn_wps_ie(struct adapter *padapter)
-{
- u8 *pwps_ie = NULL;
- u8 *pwps_ie_src;
- u8 *premainder_ie;
- u8 *pbackup_remainder_ie = NULL;
-
- unsigned int wps_ielen = 0, wps_offset, remainder_ielen;
- struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
- struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
- struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
- unsigned char *ie = pnetwork->ies;
- u32 ielen = pnetwork->ie_length;
-
- pwps_ie = rtw_get_wps_ie(ie + _FIXED_IE_LENGTH_,
- ielen - _FIXED_IE_LENGTH_,
- NULL,
- &wps_ielen);
-
- if (!pwps_ie || wps_ielen == 0)
- return;
-
- pwps_ie_src = pmlmepriv->wps_beacon_ie;
- if (!pwps_ie_src)
- return;
-
- wps_offset = (unsigned int)(pwps_ie - ie);
-
- premainder_ie = pwps_ie + wps_ielen;
-
- remainder_ielen = ielen - wps_offset - wps_ielen;
-
- if (remainder_ielen)
- pbackup_remainder_ie = kmemdup(premainder_ie, remainder_ielen, GFP_ATOMIC);
-
- wps_ielen = (unsigned int)pwps_ie_src[1];/* to get ie data len */
- if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
- memcpy(pwps_ie, pwps_ie_src, wps_ielen + 2);
- pwps_ie += (wps_ielen + 2);
-
- if (pbackup_remainder_ie)
- memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
-
- /* update ie_length */
- pnetwork->ie_length = wps_offset + (wps_ielen + 2) + remainder_ielen;
- }
-
- kfree(pbackup_remainder_ie);
-}
-
-static void update_bcn_p2p_ie(struct adapter *padapter)
-{
-}
-
-static void update_bcn_vendor_spec_ie(struct adapter *padapter, u8 *oui)
-{
- if (!memcmp(RTW_WPA_OUI, oui, 4))
- update_bcn_wpa_ie(padapter);
-
- else if (!memcmp(WMM_OUI, oui, 4))
- update_bcn_wmm_ie(padapter);
-
- else if (!memcmp(WPS_OUI, oui, 4))
- update_bcn_wps_ie(padapter);
-
- else if (!memcmp(P2P_OUI, oui, 4))
- update_bcn_p2p_ie(padapter);
-}
-
void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
{
struct mlme_priv *pmlmepriv;
@@ -1467,12 +1389,6 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
break;
- case WLAN_EID_VENDOR_SPECIFIC:
-
- update_bcn_vendor_spec_ie(padapter, oui);
-
- break;
-
default:
break;
}
--
2.54.0
next prev parent reply other threads:[~2026-06-01 15:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 15:01 [PATCH 0/2] staging: rtl8723bs: remove unreachable code in Nikolay Kulikov
2026-06-01 15:01 ` Nikolay Kulikov [this message]
2026-06-01 15:01 ` [PATCH 2/2] staging: rtl8723bs: remove unused 'oui' parameter from update_beacon() Nikolay Kulikov
2026-06-02 5:35 ` [PATCH 0/2] staging: rtl8723bs: remove unreachable code in Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260601150253.69930-2-nikolayof23@gmail.com \
--to=nikolayof23@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox