Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ada692b0 authored by Stephen Hemminger's avatar Stephen Hemminger
Browse files

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: default avatarStephen Hemminger <shemminger@vyatta.com>
parent c5ebe227
Loading
Loading
Loading
Loading
+276 −520

File changed.

Preview size limit exceeded, changes collapsed.

drivers/staging/bcm/HostMibs.h

deleted100644 → 0
+0 −7
Original line number Diff line number Diff line
#ifndef _HOST_MIBS_H
#define _HOST_MIBS_H

INT ProcessGetHostMibs(PMINI_ADAPTER Adapter,
						  PVOID ioBuffer,
						  ULONG inputBufferLength);
#endif
+2 −4
Original line number Diff line number Diff line
@@ -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);
+0 −1
Original line number Diff line number Diff line
@@ -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"
+4 −20
Original line number Diff line number Diff line
@@ -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));
}