diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 9bdd0d88fa7c1..4a193a8591499 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -1911,6 +1911,12 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, ndl_active_state_array = nla_data( tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY]); + /* Check channel count. Per 11p spec, max 2 channels allowed */ + if (!channel_count || channel_count > TGT_NUM_OCB_CHANNELS) { + hdd_err("Invalid channel_count %d", channel_count); + return -EINVAL; + } + request = osif_request_alloc(¶ms); if (!request) { hdd_err("Request allocation failure");