diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e9a2e65cefb5..70e54f98d6f8 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11581,6 +11581,11 @@ static int __wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy, return err; } + if (adapter->session_id == HDD_SESSION_ID_INVALID) { + hdd_err("Invalid session id"); + return -EINVAL; + } + if (tb[STATS_SET_START]) { if (!tb[STATS_GW_IPV4]) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index da8285071dc2..7bf868220a4b 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1369,4 +1369,13 @@ struct wma_beacon_interval_reset_req { */ int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id, uint16_t beacon_interval, uint32_t timeout); +/* + * wma_is_vdev_valid() - check the vdev status + * @vdev_id: vdev identifier + * + * This function verifies the vdev validity + * + * Return: 'true' on valid vdev else 'false' + */ +bool wma_is_vdev_valid(uint32_t vdev_id); #endif diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 236e66769231..cd3e40d1895f 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1145,7 +1145,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info, return 0; } -static bool wma_is_vdev_valid(uint32_t vdev_id) +bool wma_is_vdev_valid(uint32_t vdev_id) { tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index bdf3c292867e..7e9efab294e8 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6955,6 +6955,10 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle, __func__); return; } + if (!wma_is_vdev_valid(req_buf->vdev_id)) { + WMA_LOGE("vdev id not active or not valid"); + return; + } arp_stats = (struct set_arp_stats *)req_buf; status = wmi_unified_set_arp_stats_req(wma_handle->wmi_handle,