wlan: Do not reference userspace memory in the driver
The driver code should not access memory directly from userspace.
CRs-fixed: 429110, 429111, 429112
Change-Id: I3eb27670f477fd5db940d780d3464f2a2665fa64
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 941ae7a..673a78b 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -468,9 +468,9 @@
ret = -EFAULT;
}
}
- else if(strncmp(priv_data.buf, "SETBAND", 7) == 0)
+ else if(strncmp(command, "SETBAND", 7) == 0)
{
- tANI_U8 *ptr = (tANI_U8*)priv_data.buf ;
+ tANI_U8 *ptr = command ;
int ret = 0 ;
/* Change band request received */
@@ -478,7 +478,7 @@
/* First 8 bytes will have "SETBAND " and
* 9 byte will have band setting value */
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
- "%s: SetBandCommand Info comm %s UL %d, TL %d", __func__, priv_data.buf, priv_data.used_len, priv_data.total_len);
+ "%s: SetBandCommand Info comm %s UL %d, TL %d", __func__, command, priv_data.used_len, priv_data.total_len);
/* Change band request received */
ret = hdd_setBand_helper(dev, ptr);
@@ -501,9 +501,9 @@
command should be a string having format
SET_SAP_CHANNEL_LIST <num of channels> <the channels seperated by spaces>
*/
- else if(strncmp(priv_data.buf, "SET_SAP_CHANNEL_LIST", 20) == 0)
+ else if(strncmp(command, "SET_SAP_CHANNEL_LIST", 20) == 0)
{
- tANI_U8 *ptr = (tANI_U8*)priv_data.buf;
+ tANI_U8 *ptr = command;
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
" Received Command to Set Preferred Channels for SAP in %s", __func__);