view cdg3/sap/cl.pdf @ 516:1ed9de6c90bd

src/g23m-gsm/sms/sms_for.c: bogus malloc removed The new error handling code that was not present in TCS211 blob version contains a malloc call that is bogus for 3 reasons: 1) The memory allocation in question is not needed in the first place; 2) libc malloc is used instead of one of the firmware's proper ways; 3) The memory allocation is made inside a function and then never freed, i.e., a memory leak. This bug was caught in gcc-built FreeCalypso fw projects (Citrine and Selenite) because our gcc environment does not allow any use of libc malloc (any reference to malloc produces a link failure), but this code from TCS3.2 is wrong even for Magnetite: if this code path is executed repeatedly over a long time, the many small allocations made by this malloc call without a subsequent free will eventually exhaust the malloc heap provided by the TMS470 environment, malloc will start returning NULL, and the bogus code will treat it as an error. Because the memory allocation in question is not needed at all, the fix entails simply removing it.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 22 Jul 2018 06:04:49 +0000
parents c15047b3d00d
children
line wrap: on
line source

;********************************************************************************
;*** File           : cl.pdf
;*** Creation       : Wed Mar 11 09:58:08 CST 2009
;*** XSLT Processor : Apache Software Foundation / http://xml.apache.org/xalan-j / supports XSLT-Ver: 1
;*** Copyright      : (c) Texas Instruments AG, Berlin Germany 2002
;********************************************************************************
;*** Document Type  : Service Access Point Specification
;*** Document Name  : cl
;*** Document No.   : 8010.149.04.012
;*** Document Date  : 2004-06-08
;*** Document Status: SUBMITTED
;*** Document Author: rpk
;********************************************************************************



PRAGMA 	SRC_FILE_TIME 	"Thu Nov 29 09:38:38 2007"
PRAGMA 	LAST_MODIFIED 	"2004-06-08"
PRAGMA 	ID_AND_VERSION 	"8010.149.04.012"
PRAGMA 	PREFIX 	CL 	; Prefix for this document
PRAGMA 	ALLWAYS_ENUM_IN_VAL_FILE 	NO 	; Adds enumerations in the .val file.
PRAGMA 	ENABLE_GROUP 	NO 	; Enable h-file grouping
PRAGMA 	COMPATIBILITY_DEFINES 	NO 	; Compatible to the old #defines



CONST 	DUMMY 	0xFF 	; Just for avoiding error



VALTAB 	VAL_qos_conv_res
VAL 	0x01 	CONV_OK 	"Conversion successful."
VAL 	0x00 	CONV_FAILED 	"Conversion failed"




VAR 	qos_conv_res 	"Result of qos conversion " 	B

VAL 	@p_cl - VAL_qos_conv_res@ 	







; CL_NWRL_SET_SGSN_RELEASE_REQ 	0x8000009C
; CL_NWRL_SET_SGSN_RELEASE_CNF 	0x8000409C
; CL_NWRL_GET_SGSN_RELEASE_REQ 	0x8001009C
; CL_NWRL_GET_SGSN_RELEASE_CNF 	0x8001409C



PRIM 	CL_NWRL_SET_SGSN_RELEASE_REQ 	0x8000009C
{
 	EXTERN @p_8010_152_ps_include - sgsn_rel@ 	sgsn_rel 	 ; Input: SGSN release
}






PRIM 	CL_NWRL_SET_SGSN_RELEASE_CNF 	0x8000409C
{
}






PRIM 	CL_NWRL_GET_SGSN_RELEASE_REQ 	0x8001009C
{
}






PRIM 	CL_NWRL_GET_SGSN_RELEASE_CNF 	0x8001409C
{
 	EXTERN @p_8010_152_ps_include - sgsn_rel@ 	sgsn_rel 	 ; Output: SGSN Release
}