From 4933c3a2907a614612418a9caee467ff55ddfd3d Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 10 Jan 2018 19:33:33 -0800 Subject: [PATCH] qcacld-3.0: Utilize wlan_is_ie_valid() In change "qcacld-3.0: Validate Scan Default IEs" in the qcacld-3.0 project (Change-Id: Ifd8739c96a9990f01ff159eb59a7e904f7b8c592) the utility API hdd_is_ie_valid() was introduced. One review comments was that this should be a converged API. Subsequently change "qcacmn: Introduce wlan_is_ie_valid()" in the qcacmn project (Change-Id: I8d2a520ea70645ab54b450de83452c0035653485) created the converged API wlan_is_ie_valid(), so now remove hdd_is_ie_valid() and instead use wlan_is_ie_valid(). Change-Id: I60fcba09e9c962b7891315cea0e273db88a3d49d CRs-Fixed: 2170493 --- core/hdd/src/wlan_hdd_cfg80211.c | 23 +---------------------- core/hdd/src/wlan_hdd_cfg80211.h | 15 --------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 6892fcd83a91..b31f29788fc2 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -668,27 +668,6 @@ static const struct wiphy_wowlan_support wowlan_support_cfg80211_init = { }; #endif -bool hdd_is_ie_valid(const uint8_t *ie, size_t ie_len) -{ - uint8_t elen; - - while (ie_len) { - if (ie_len < 2) - return false; - - elen = ie[1]; - ie_len -= 2; - ie += 2; - if (elen > ie_len) - return false; - - ie_len -= elen; - ie += elen; - } - - return true; -} - /** * hdd_add_channel_switch_support()- Adds Channel Switch flag if supported * @flags: Pointer to the flags to Add channel switch flag. @@ -6588,7 +6567,7 @@ static int hdd_config_scan_default_ies(struct hdd_adapter *adapter, } scan_ie = nla_data(attr); - if (!hdd_is_ie_valid(scan_ie, scan_ie_len)) { + if (!wlan_is_ie_valid(scan_ie, scan_ie_len)) { hdd_err("Invalid default scan IEs"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 9454b1185edb..694f19422857 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -223,21 +223,6 @@ typedef enum { #define CFG_PROPAGATION_DELAY_BASE (64) #define CFG_AGG_RETRY_MIN (5) -/** - * hdd_is_ie_valid() - Determine if an IE sequence is valid - * @ie: Pointer to the IE buffer - * @ie_len: Length of the IE buffer @ie - * - * This function validates that the IE sequence is valid by verifying - * that the sum of the lengths of the embedded elements match the - * length of the sequence. - * - * Note well that a 0-length IE sequence is considered valid. - * - * Return: true if the IE sequence is valid, false if it is invalid - */ -bool hdd_is_ie_valid(const uint8_t *ie, size_t ie_len); - struct cfg80211_bss * wlan_hdd_cfg80211_update_bss_db(struct hdd_adapter *adapter, struct csr_roam_info *roam_info);