summaryrefslogtreecommitdiff
path: root/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c')
-rw-r--r--software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
index 43bb1ed..c0c9d2a 100644
--- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
+++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
@@ -1293,30 +1293,40 @@ UINT32 Oct6100ChannelOpenSer(
IN tPOCT6100_INSTANCE_API f_pApiInstance,
IN OUT tPOCT6100_CHANNEL_OPEN f_pChannelOpen )
{
- tOCT6100_API_ECHO_CHAN_INDEX ChannelIndexConf;
+ tOCT6100_API_ECHO_CHAN_INDEX *ChannelIndexConf;
UINT32 ulResult;
+ ChannelIndexConf = kmalloc(sizeof(*ChannelIndexConf), GFP_KERNEL);
+
+ if (!ChannelIndexConf)
+ return cOCT6100_ERR_FATAL_0;
+
/* Check the user's configuration of the echo cancellation channel for errors. */
- ulResult = Oct6100ApiCheckChannelParams( f_pApiInstance, f_pChannelOpen, &ChannelIndexConf );
+ ulResult = Oct6100ApiCheckChannelParams( f_pApiInstance, f_pChannelOpen, ChannelIndexConf );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Reserve all resources needed by the echo cancellation channel. */
- ulResult = Oct6100ApiReserveChannelResources( f_pApiInstance, f_pChannelOpen, &ChannelIndexConf );
+ ulResult = Oct6100ApiReserveChannelResources( f_pApiInstance, f_pChannelOpen, ChannelIndexConf );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Write all necessary structures to activate the echo cancellation channel. */
- ulResult = Oct6100ApiWriteChannelStructs( f_pApiInstance, f_pChannelOpen, &ChannelIndexConf );
+ ulResult = Oct6100ApiWriteChannelStructs( f_pApiInstance, f_pChannelOpen, ChannelIndexConf );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
/* Update the new echo cancellation channels's entry in the ECHO channel list. */
- ulResult = Oct6100ApiUpdateChannelEntry( f_pApiInstance, f_pChannelOpen, &ChannelIndexConf );
+ ulResult = Oct6100ApiUpdateChannelEntry( f_pApiInstance, f_pChannelOpen, ChannelIndexConf );
if ( ulResult != cOCT6100_ERR_OK )
- return ulResult;
+ goto out;
+ kfree(ChannelIndexConf);
return cOCT6100_ERR_OK;
+
+out:
+ kfree(ChannelIndexConf);
+ return ulResult;
}
#endif
@@ -3564,7 +3574,7 @@ UINT32 Oct6100ChannelModifySer(
/* 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;
+ return cOCT6100_ERR_FATAL_0;
/* Check the user's configuration of the echo cancellation channel for errors. */
ulResult = Oct6100ApiCheckChannelModify( f_pApiInstance,