提交 ada692b0 编写于 作者: S Stephen Hemminger

beceem: fix character device ioctl

Sparse caught several places where ioctl interface was incorrectly using user
memory. Fix all the ioctl cases for casting and __user annotation.
Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
上级 c5ebe227
此差异已折叠。
#ifndef _HOST_MIBS_H
#define _HOST_MIBS_H
INT ProcessGetHostMibs(PMINI_ADAPTER Adapter,
PVOID ioBuffer,
ULONG inputBufferLength);
#endif
......@@ -108,10 +108,8 @@ void SendIdleModeResponse(PMINI_ADAPTER Adapter);
void HandleShutDownModeRequest(PMINI_ADAPTER Adapter,PUCHAR pucBuffer);
int ProcessGetHostMibs(PMINI_ADAPTER Adapter, PVOID ioBuffer,
ULONG inputBufferLength);
int GetDroppedAppCntrlPktMibs(PVOID ioBuffer, PPER_TARANG_DATA pTarang);
int ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *buf);
void GetDroppedAppCntrlPktMibs(S_MIBS_HOST_STATS_MIBS *ioBuffer, PPER_TARANG_DATA pTarang);
void beceem_parse_target_struct(PMINI_ADAPTER Adapter);
void doPowerAutoCorrection(PMINI_ADAPTER psAdapter);
......
......@@ -56,7 +56,6 @@
#include "CmHost.h"
#include "DDRInit.h"
#include "Debug.h"
#include "HostMibs.h"
#include "IPv6ProtocolHdr.h"
#include "PHSModule.h"
#include "Protocol.h"
......
......@@ -10,12 +10,8 @@
*/
#include "headers.h"
INT ProcessGetHostMibs(PMINI_ADAPTER Adapter,
PVOID ioBuffer,
ULONG inputBufferLength)
INT ProcessGetHostMibs(PMINI_ADAPTER Adapter, S_MIBS_HOST_STATS_MIBS *pstHostMibs)
{
S_MIBS_HOST_STATS_MIBS *pstHostMibs = NULL;
S_SERVICEFLOW_ENTRY *pstServiceFlowEntry = NULL;
S_PHS_RULE *pstPhsRule = NULL;
S_CLASSIFIER_TABLE *pstClassifierTable = NULL;
......@@ -30,15 +26,6 @@ INT ProcessGetHostMibs(PMINI_ADAPTER Adapter,
return STATUS_FAILURE;
}
if(ioBuffer == NULL)
{
return -EINVAL;
}
memset(ioBuffer,0,sizeof(S_MIBS_HOST_STATS_MIBS));
pstHostMibs = (S_MIBS_HOST_STATS_MIBS *)ioBuffer;
//Copy the classifier Table
for(nClassifierIndex=0; nClassifierIndex < MAX_CLASSIFIERS;
nClassifierIndex++)
......@@ -115,13 +102,10 @@ INT ProcessGetHostMibs(PMINI_ADAPTER Adapter,
}
INT GetDroppedAppCntrlPktMibs(PVOID ioBuffer, PPER_TARANG_DATA pTarang)
VOID GetDroppedAppCntrlPktMibs(S_MIBS_HOST_STATS_MIBS *pstHostMibs, const PPER_TARANG_DATA pTarang)
{
S_MIBS_HOST_STATS_MIBS *pstHostMibs = (S_MIBS_HOST_STATS_MIBS *)ioBuffer;
memcpy((PVOID)&(pstHostMibs->stDroppedAppCntrlMsgs),(PVOID)&(pTarang->stDroppedAppCntrlMsgs),sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES));
return STATUS_SUCCESS ;
memcpy(&(pstHostMibs->stDroppedAppCntrlMsgs),
&(pTarang->stDroppedAppCntrlMsgs),sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册