annotate components/frame_na7_db_ir @ 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 b4dd8c7e84ce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
297
1b561dd0368b components/frame_na7_db_ir: comment fix
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
1 # Building frame_na7_db_ir.lib using the GPF source bits we got with TCS3.2
295
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2
296
154011ef41b1 components/frame_na7_db_{fl,ir}: missed the -o3
Mychaela Falconia <falcon@freecalypso.org>
parents: 295
diff changeset
3 CFLAGS="-mw -x -pw2 -o3 -me -mt -g -mn"
295
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 # Defines
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 CPPFLAGS="-DNU_DEBUG -D_FF_RV_EXIST_ -DRUN_INT_RAM"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 CPPFLAGS="$CPPFLAGS -D_TARGET_ -D_NUCLEUS_"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 # Includes
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 CPPFLAGS="$CPPFLAGS -I$SRC/$GPF/frame"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 CPPFLAGS="$CPPFLAGS -I$SRC/$GPF/inc/nuc"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 CPPFLAGS="$CPPFLAGS -I$SRC/$GPF/inc/nuc/arm7"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 CPPFLAGS="$CPPFLAGS -I$SRC/$GPF/inc"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 CPPFLAGS="$CPPFLAGS -I$SRC/gpf2/tst"
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 # Source modules
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 SRCDIR=$SRC/gpf3/frame
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 cfile_plain $SRCDIR/frame.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 cfile_plain $SRCDIR/vsi_sem.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 cfile_plain $SRCDIR/vsi_com.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 cfile_plain $SRCDIR/vsi_mem.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 cfile_plain $SRCDIR/vsi_tim.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 cfile_plain $SRCDIR/vsi_mis.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 cfile_plain $SRCDIR/vsi_drv.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 cfile_plain $SRCDIR/vsi_trc.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 cfile_plain $SRCDIR/vsi_pro.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 cfile_plain $SRCDIR/xalert.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 cfile_plain $SRCDIR/route.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 cfile_plain $SRCDIR/prf_func.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 cfile_plain $SRCDIR/frm_ext.c
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 cfile_plain $SRCDIR/frame_version.c
489
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
36
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
37 # OSL
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
38
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
39 # drop -o3
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
40 CFLAGS="-mw -x -pw2 -o -me -mt -g -mn"
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
41
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
42 SRCDIR=$SRC/gpf2/osl
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
43
f89439ce0d45 OSL: os_com_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 297
diff changeset
44 cfile_plain $SRCDIR/os_com_ir.c
494
e9bdc8184d50 OSL: os_mem_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 489
diff changeset
45 cfile_plain $SRCDIR/os_mem_ir.c
496
2d1e5ad1d54f OSL: os_mis_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 494
diff changeset
46 cfile_plain $SRCDIR/os_mis_ir.c
498
dfa8771e84b1 OSL: os_pro_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 496
diff changeset
47 cfile_plain $SRCDIR/os_pro_ir.c
500
094ecae40880 OSL: os_sem_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 498
diff changeset
48 cfile_plain $SRCDIR/os_sem_ir.c
502
b4dd8c7e84ce OSL: os_tim_ir.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 500
diff changeset
49 cfile_plain $SRCDIR/os_tim_ir.c