summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
index 40a94f5..1a204b2 100644
--- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
+++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
@@ -32,6 +32,8 @@ $Octasic_Revision: 469 $
/***************************** INCLUDE FILES *******************************/
+#include <linux/slab.h>
+
#include "octdef.h"
#include "oct6100api/oct6100_defines.h"
@@ -3490,16 +3492,21 @@ UINT32 Oct6100ChannelModifySer(
UINT8 fSinSoutCodecActive = FALSE;
UINT8 fRinRoutCodecActive = FALSE;
UINT16 usNewPhasingTsstIndex;
- tOCT6100_CHANNEL_OPEN TempChanOpen;
+ tOCT6100_CHANNEL_OPEN *pTempChanOpen;
+
+ /* We don't want this 290 byte structure on the stack */
+ pTempChanOpen = kmalloc(sizeof(*pTempChanOpen), GFP_ATOMIC);
+ if (!pTempChanOpen)
+ return cOCT6100_ERR_CHANNEL_NOT_OPEN;
/* Check the user's configuration of the echo cancellation channel for errors. */
ulResult = Oct6100ApiCheckChannelModify( f_pApiInstance,
f_pChannelModify,
- &TempChanOpen,
+ pTempChanOpen,
&usNewPhasingTsstIndex,
&usChanIndex );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Reserve all resources needed by the echo cancellation channel. */
ulResult = Oct6100ApiModifyChannelResources( f_pApiInstance,
@@ -3510,12 +3517,12 @@ UINT32 Oct6100ChannelModifySer(
&usNewRoutTsstIndex,
&usNewSoutTsstIndex );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Write all necessary structures to activate the echo cancellation channel. */
ulResult = Oct6100ApiModifyChannelStructs( f_pApiInstance,
f_pChannelModify,
- &TempChanOpen,
+ pTempChanOpen,
usChanIndex,
usNewPhasingTsstIndex,
&fSinSoutCodecActive,
@@ -3525,12 +3532,12 @@ UINT32 Oct6100ChannelModifySer(
usNewRoutTsstIndex,
usNewSoutTsstIndex );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Update the new echo cancellation channels's entry in the ECHO channel list. */
ulResult = Oct6100ApiModifyChannelEntry( f_pApiInstance,
f_pChannelModify,
- &TempChanOpen,
+ pTempChanOpen,
usChanIndex,
usNewPhasingTsstIndex,
fSinSoutCodecActive,
@@ -3542,7 +3549,10 @@ UINT32 Oct6100ChannelModifySer(
if ( ulResult != cOCT6100_ERR_OK )
return ulResult;
- return cOCT6100_ERR_OK;
+out:
+ kfree(pTempChanOpen);
+
+ return ulResult;
}
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\