view cdg211/cdginc/p_gmmsm.val @ 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 56abf6cf8a0b
children
line wrap: on
line source

/*
+--------------------------------------------------------------------------+
| PROJECT : PROTOCOL STACK                                                 |
| FILE    : p_gmmsm.val                                                    |
| SOURCE  : "__out__\g23m_dfile\prim\gmmsm.pdf"                            |
| LastModified : "2003-01-23"                                              |
| IdAndVersion : "8441.106.00.005"                                         |
| SrcFileTime  : "Mon Nov 24 15:49:28 2003"                                |
| Generated by CCDGEN_2.5.5 on Fri Jun 08 13:59:15 2007                    |
|           !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!!                |
+--------------------------------------------------------------------------+
*/

/* PRAGMAS
 * PREFIX                 : NONE
 * COMPATIBILITY_DEFINES  : NO (require PREFIX)
 * ALWAYS_ENUM_IN_VAL_FILE: NO
 * ENABLE_GROUP: NO
 * CAPITALIZE_TYPENAME: NO
 */


#ifndef P_GMMSM_VAL
#define P_GMMSM_VAL


#define CDG_ENTER__P_GMMSM_VAL

#define CDG_ENTER__FILENAME _P_GMMSM_VAL
#define CDG_ENTER__P_GMMSM_VAL__FILE_TYPE CDGINC
#define CDG_ENTER__P_GMMSM_VAL__LAST_MODIFIED _2003_01_23
#define CDG_ENTER__P_GMMSM_VAL__ID_AND_VERSION _8441_106_00_005

#define CDG_ENTER__P_GMMSM_VAL__SRC_FILE_TIME _Mon_Nov_24_15_49_28_2003

#include "CDG_ENTER.h"

#undef CDG_ENTER__P_GMMSM_VAL

#undef CDG_ENTER__FILENAME


/*
 * Value constants for VAL_sm_cause
 */
#define VAL_SM_CAUSE___DEF             (0x0)      /* Protocol error, unspecified    */
#define SM_ERRCS_IMSI_UNKNOWN          (0xa02)    /* IMSI unknown in HLR            */
#define SM_ERRCS_ILLEGAL_MS            (0xa03)    /* Illegal MS                     */
#define SM_ERRCS_IMEI_NOT_ACCEPTED     (0xa04)    /* IMEI not accepted              */
#define SM_ERRCS_ILLEGAL_ME            (0xa06)    /* Illegal ME                     */
#define SM_ERRCS_GPRS_NOT_ALLOWED      (0xa07)    /* GPRS services not allowed      */
#define SM_ERRCS_GSM_GPRS_NOT_ALLOWED  (0xa08)    /* GPRS services and non-GPRS services not allowed */
#define SM_ERRCS_NO_MS_ID              (0xa09)    /* MS identity cannot be derived by the network */
#define SM_ERRCS_IMPLICIT_DETACHED     (0xa0a)    /* Implicitly detached            */
#define SM_ERRCS_PLMN_NOT_ALLOWED      (0xa0b)    /* PLMN not allowed               */
#define SM_ERRCS_LA_NOT_ALLOWED        (0xa0c)    /* Location Area not allowed      */
#define SM_ERRCS_ROAMING_NOT_ALLOWED   (0xa0d)    /* Roaming not allowed in this location area */
#define SM_ERRCS_MSC_TEMP_NOT_RECHABLE (0xa10)    /* MSC temporarily not reachable  */
#define SM_ERRCS_NET_FAIL              (0xa11)    /* Network failure                */
#define SM_ERRCS_CONGESTION            (0xa16)    /* Congestion                     */
#define SM_ERRCS_SEMANTIC_INCORRECT    (0xa5f)    /* Semantically incorrect message */
#define SM_ERRCS_INVALID_M_INFO        (0xa60)    /* Invalid mandatory information  */
#define SM_ERRCS_TYPE_INVALID          (0xa61)    /* Message type non-existent or not implemented */
#define SM_ERRCS_TYPE_INCOMPATIBLE     (0xa62)    /* Message type not compatible with the protocol state */
#define SM_ERRCS_IE_INVALID            (0xa63)    /* Information element non-existent or not implemented */
#define SM_ERRCS_COND_IE_ERROR         (0xa64)    /* Conditional IE error           */
#define SM_ERRCS_MESSAGE_INVALID       (0xa65)    /* Message not compatible with the protocol state */
#define SM_ERRCS_PROTOCOL_ERROR        (0xa6f)    /* Protocol error, unspecified    */
#define SM_ERRCS_POWER_OFF             (0xa70)    /* local detach on power off      */

/*
 * Value constants for VAL_nsapi
 */
#define VAL_NSAPI___DEF                (0x0)      /* reserved                       */
#define GMMSM_NSAPI_5                  (0x5)      /* NSAPI 5                        */
#define GMMSM_NSAPI_6                  (0x6)      /* NSAPI 6                        */
#define GMMSM_NSAPI_7                  (0x7)      /* NSAPI 7                        */
#define GMMSM_NSAPI_8                  (0x8)      /* NSAPI 8                        */
#define GMMSM_NSAPI_9                  (0x9)      /* NSAPI 9                        */
#define GMMSM_NSAPI_10                 (0xa)      /* NSAPI 10                       */
#define GMMSM_NSAPI_11                 (0xb)      /* NSAPI 11                       */
#define GMMSM_NSAPI_12                 (0xc)      /* NSAPI 12                       */
#define GMMSM_NSAPI_13                 (0xd)      /* NSAPI 13                       */
#define GMMSM_NSAPI_14                 (0xe)      /* NSAPI 14                       */
#define GMMSM_NSAPI_15                 (0xf)      /* NSAPI 15                       */

/*
 * user defined constants
 */
#define GMMSM_MAX_N_PDU_NUMBER_LIST    (0x10)     

#include "CDG_LEAVE.h"


#endif