summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-18 10:12:04 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-18 10:12:04 -0700
commit8dae5a34a0b244db36e61b3c8de390d8ff03713b (patch)
tree597cbcd79c515ff8eb34cb790595b262ec05e775
parent0329b31dd4850be5870f0633e155674bc4e167ff (diff)
parent82061f8fbad6a9a3ed0d57f7e4e6b24a0a8d0a55 (diff)
Merge "qcacld-2.0: Validate NLA attr in wlan_hdd_cfg80211_ocb_set_config API" into wlan-cld2.driver.lnx.1.0-dev
-rw-r--r--CORE/HDD/src/wlan_hdd_ocb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_ocb.c b/CORE/HDD/src/wlan_hdd_ocb.c
index 7c44a1747b85..3734925ec34d 100644
--- a/CORE/HDD/src/wlan_hdd_ocb.c
+++ b/CORE/HDD/src/wlan_hdd_ocb.c
@@ -953,10 +953,18 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE]);
/* Get the ndl chan array and the ndl active state array. */
+ if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY]) {
+ hddLog(LOGE, FL("NDL_CHANNEL_ARRAY is not present"));
+ return -EINVAL;
+ }
ndl_chan_list =
tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY];
ndl_chan_list_len = (ndl_chan_list ? nla_len(ndl_chan_list) : 0);
+ if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY]) {
+ hddLog(LOGE, FL("NDL_ACTIVE_STATE_ARRAY is not present"));
+ return -EINVAL;
+ }
ndl_active_state_list =
tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY];
ndl_active_state_list_len = (ndl_active_state_list ?
@@ -1003,6 +1011,10 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
config->def_tx_param_size = def_tx_param_size;
/* Read the channel array */
+ if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY]) {
+ hddLog(LOGE, FL("CHANNEL_ARRAY is not present"));
+ return -EINVAL;
+ }
channel_array = tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY];
if (!channel_array) {
hddLog(LOGE, FL("No channel present"));