annotate components/frame_na7_db_fl @ 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 c4117b996197
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
295
1aa8cab15e14 components/frame_na7_db_{fl,ir} created as an experiment
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 # Building frame_na7_db_fl.lib using the GPF source bits we got with TCS3.2
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_FLASH"
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
488
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
36
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
37 # OSL
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
38
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
39 # drop -o3
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
40 CFLAGS="-mw -x -pw2 -o -me -mt -g -mn"
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
41
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
42 SRCDIR=$SRC/gpf2/osl
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
43
ff91db8c9eb8 OSL: os_com_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 296
diff changeset
44 cfile_plain $SRCDIR/os_com_fl.c
491
045d641c9bfa OSL: os_drv.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 488
diff changeset
45 cfile_plain $SRCDIR/os_drv.c
492
10c059efb3d1 OSL: os_isr.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 491
diff changeset
46 cfile_plain $SRCDIR/os_isr.c
493
2e73bbc0648e OSL: os_mem_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 492
diff changeset
47 cfile_plain $SRCDIR/os_mem_fl.c
495
9e55fe3a5ee4 OSL: os_mis_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 493
diff changeset
48 cfile_plain $SRCDIR/os_mis_fl.c
497
bc12e6de8a07 OSL: os_pro_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 495
diff changeset
49 cfile_plain $SRCDIR/os_pro_fl.c
499
27db9775cbab OSL: os_sem_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 497
diff changeset
50 cfile_plain $SRCDIR/os_sem_fl.c
501
c4117b996197 OSL: os_tim_fl.c compiles
Mychaela Falconia <falcon@freecalypso.org>
parents: 499
diff changeset
51 cfile_plain $SRCDIR/os_tim_fl.c