FreeCalypso > hg > fc-magnetite
annotate cdg-hybrid/sap/tb.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 | e7a67accfad9 |
children |
rev | line source |
---|---|
212
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 ;******************************************************************************** |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ;*** File : tb.pdf |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 ;*** Creation : Wed Mar 11 09:58:52 CST 2009 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 ;*** XSLT Processor : Apache Software Foundation / http://xml.apache.org/xalan-j / supports XSLT-Ver: 1 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 ;*** Copyright : (c) Texas Instruments AG, Berlin Germany 2002 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 ;******************************************************************************** |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 ;*** Document Type : Service Access Point Specification |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ;*** Document Name : tb |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 ;*** Document No. : 8441.112.01.002 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 ;*** Document Date : 2001-07-17 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 ;*** Document Status: BEING_PROCESSED |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 ;*** Document Author: SAB |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ;******************************************************************************** |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 PRAGMA SRC_FILE_TIME "Thu Nov 29 09:54:48 2007" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 PRAGMA LAST_MODIFIED "2001-07-17" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 PRAGMA ID_AND_VERSION "8441.112.01.002" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 CONST TB_BA_LIST_SIZE 33 ; BA list size |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 VALTAB VAL_arfcn |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 VAL 1 - 124 "GSM 900 without extension band" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 VAL 1 - 174 "GSM 900 with extension band" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 VAL 512 - 810 "PCS 1900" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 VAL 512 - 885 "DCS 1800" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 VAL 1 - 498 "Dual band(GSM/DCS)" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 VAL 1 - 548 "Dual band(EGSM/DCS)" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 VAL 0xFFFF TB_INVALID_ARFCN "Used to mark a channel number entry as invalid." |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 VAR num_meas "number" B |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 VAR rxlev "measurement value" S |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 VAR arfcn "channel number" S |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 VAL @p_tb - VAL_arfcn@ |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 VAR sc_rxlev "RXLEV value of the serving cell." B |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 COMP tb_meas_result "" |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 { |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 arfcn ; Channel Number |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 rxlev ; ACC Level |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 num_meas ; ACC nbr |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 } |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 ; TB_MEAS_IND 0x1800 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 ; TB_RXLEV_SC_REQ 0x5800 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 PRIM TB_MEAS_IND 0x1800 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 { |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 tb_meas_result [TB_BA_LIST_SIZE] ; Measurement result |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 } |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 PRIM TB_RXLEV_SC_REQ 0x5800 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 { |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 sc_rxlev ; RXLEV Serving Cell |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 } |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 |
e7a67accfad9
cdg-hybrid cdginc headers created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 |