diff options
| author | Mukul Sharma <mukul@codeaurora.org> | 2017-09-21 19:20:00 +0530 |
|---|---|---|
| committer | Mukul Sharma <mukul@codeaurora.org> | 2017-09-24 12:37:06 +0530 |
| commit | 5c54ee6ea91cac37045ddfa1ae4c6dbfba29528f (patch) | |
| tree | 37feac383310223d258381c3945c6b65efb0910e | |
| parent | e987c7a0f4b9fdc8f1621cdb5f7e94564444c8bf (diff) | |
qcacld-3.0: Add vdev sanity check for packet filter command
Add sta vdev sanity check for packet filter command.
Change-Id: Ie76d1725637c5f4cd960102fd51a92a8e0c17eca
CRs-fixed: 2113726
| -rw-r--r-- | core/wma/src/wma_features.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index b1bd594935dc..01a975ed8fdf 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -6639,6 +6639,7 @@ int wma_process_receive_filter_set_filter_req(tp_wma_handle wma, { int ret = 0; uint8_t vdev_id; + struct wma_txrx_node *iface; /* Get the vdev id */ if (!wma_find_vdev_by_bssid(wma, @@ -6648,8 +6649,21 @@ int wma_process_receive_filter_set_filter_req(tp_wma_handle wma, return -EINVAL; } - ret = wma_config_packet_filter(wma, vdev_id, rcv_filter_param, - rcv_filter_param->filterId, true); + iface = &(wma->interfaces[vdev_id]); + if (!iface) { + WMA_LOGE("vdev is null"); + return -EINVAL; + } + + if (iface->type == WMI_VDEV_TYPE_STA && + iface->sub_type == 0) + ret = wma_config_packet_filter(wma, vdev_id, rcv_filter_param, + rcv_filter_param->filterId, true); + else { + WMA_LOGE("Invalid vdev type %d sub_type %d for pkt filter cmd", + iface->type, iface->sub_type); + return -EINVAL; + } return ret; } @@ -6666,6 +6680,7 @@ int wma_process_receive_filter_clear_filter_req(tp_wma_handle wma, { int ret = 0; uint8_t vdev_id; + struct wma_txrx_node *iface; /* Get the vdev id */ if (!wma_find_vdev_by_addr(wma, @@ -6676,8 +6691,21 @@ int wma_process_receive_filter_clear_filter_req(tp_wma_handle wma, return -EINVAL; } - ret = wma_config_packet_filter(wma, vdev_id, NULL, + iface = &(wma->interfaces[vdev_id]); + if (!iface) { + WMA_LOGE("vdev is null"); + return -EINVAL; + } + + if (iface->type == WMI_VDEV_TYPE_STA && + iface->sub_type == 0) + ret = wma_config_packet_filter(wma, vdev_id, NULL, rcv_clear_param->filterId, false); + else { + WMA_LOGE("Invalid vdev type %d sub_type %d for pkt filter cmd", + iface->type, iface->sub_type); + return -EINVAL; + } return ret; } |
