|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2017-2018, 2021 The Linux Foundation. All rights reserved.
|
|
|
*
|
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
@@ -118,7 +118,7 @@ QDF_STATUS target_if_pmo_set_multiple_mc_filter_req(
|
|
|
{
|
|
|
uint8_t vdev_id;
|
|
|
struct wlan_objmgr_psoc *psoc;
|
|
|
- struct pmo_mcast_filter_params filter_params;
|
|
|
+ struct pmo_mcast_filter_params *filter_params;
|
|
|
QDF_STATUS status;
|
|
|
wmi_unified_t wmi_handle;
|
|
|
|
|
@@ -134,25 +134,34 @@ QDF_STATUS target_if_pmo_set_multiple_mc_filter_req(
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
- filter_params.multicast_addr_cnt = mc_list->mc_cnt;
|
|
|
- qdf_mem_copy(filter_params.multicast_addr,
|
|
|
+ filter_params = qdf_mem_malloc(sizeof(*filter_params));
|
|
|
+ if (!filter_params) {
|
|
|
+ target_if_err("memory alloc failed for filter_params");
|
|
|
+ return QDF_STATUS_E_NOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ filter_params->multicast_addr_cnt = mc_list->mc_cnt;
|
|
|
+ qdf_mem_copy(filter_params->multicast_addr,
|
|
|
mc_list->mc_addr,
|
|
|
mc_list->mc_cnt * ATH_MAC_LEN);
|
|
|
/* add one/multiple mc list */
|
|
|
- filter_params.action = 1;
|
|
|
+ filter_params->action = 1;
|
|
|
|
|
|
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
|
|
if (!wmi_handle) {
|
|
|
target_if_err("Invalid wmi handle");
|
|
|
+ qdf_mem_free(filter_params);
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
status = wmi_unified_multiple_add_clear_mcbc_filter_cmd(wmi_handle,
|
|
|
vdev_id,
|
|
|
- &filter_params);
|
|
|
+ filter_params);
|
|
|
if (status)
|
|
|
target_if_err("Failed to send add/clear mcbc filter cmd");
|
|
|
|
|
|
+ qdf_mem_free(filter_params);
|
|
|
+
|
|
|
return status;
|
|
|
}
|
|
|
|