FreeCalypso > hg > fc-magnetite
annotate src/ui3/mfw/mfw_cb.h @ 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 | e8ddbb0837ed |
children |
rev | line source |
---|---|
420
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 +--------------------------------------------------------------------+ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | PROJECT: GSM-MFW (?) $Workfile:: mfw_cb.h $| |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 | $Author:: Es $Revision:: 1 $| |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 | CREATED: 14.10.98 $Modtime:: 27.10.98 17:32 $| |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | STATE : code | |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 +--------------------------------------------------------------------+ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 PURPOSE : Types definitions for MMI framework call backs distribution |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 $History:: mfw_cm.h $ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 May 10, 2006 REF: DRT OMAPS00075829 xdeepadh |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 Description: Submission of ACI and SAP changes for Imaging ERs |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 Solution: Using the mechanism where MFW can receive primitives without |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 ACI to know about it. |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 x0018858 24 Mar, 2005 MMI-FIX-11321 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 Issue Description :- If the inbox is full and a new message is receivd, no indication is received. |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 Fix: Added support for handling indication when message box is full and |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 there is a pending message. |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 . |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #ifndef DEF_MFW_CB_HEADER |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #define DEF_MFW_CB_HEADER |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 // May 10, 2006 REF: DRT OMAPS00075829 xdeepadh |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #if defined(FF_MMI_FILEMANAGER)||defined(FF_MMI_CAMERA_APP) |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /*Defining the premitive*/ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #define MSL_MMI_IND 0x110 /*Specifying hex value */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 typedef struct |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 { |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 U32 handle; /*< 0: 4> Basic Element */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 U32 appData; /*< 4: 4> Basic Element */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 U32 message; /*< 8: 4> Basic Element */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 U32 ucp; /*< 12: 4> Basic Element */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 } T_MSL_MMI_IND; |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #endif //defined(FF_MMI_FILEMANAGER)||defined(FF_MMI_CAMERA_APP) |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 /* |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 * not yet defined in aci_cmh.h |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 */ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #define CME_ERR_SimPin2Req 35 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #define CME_ERR_SimPuk2Req 36 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 // x0018858 24 Mar, 2005 MMI-FIX-11321 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 extern UBYTE sms_check_message_pending(void); |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 // May 10, 2006 REF: DRT OMAPS00075829 xdeepadh |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #if defined(FF_MMI_FILEMANAGER)||defined(FF_MMI_CAMERA_APP) |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 GLOBAL BOOL mslPrimHandler (USHORT opc, void * data) ; |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 GLOBAL void Mslil_msl_mmi_ind ( T_MSL_MMI_IND *msl_mmi_ind); /*a0393213 compiler warning removal - removed const*/ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 /*a0393213 cphs rel4*/ |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 #ifdef FF_CPHS_REL4 |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 GLOBAL void rAT_PercentCFIS ( T_ACI_CFIS_CFU *cfis ); |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 #endif |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 #endif //#if defined(FF_MMI_FILEMANAGER)||defined(FF_MMI_CAMERA_APP) |
e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #endif |