FreeCalypso > hg > fc-magnetite
view configs/hybrid @ 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 | fe200bd2f188 |
children | 69e52afc01d5 |
line wrap: on
line source
# This hybrid configuration is an attempt to graft the G23M PS and ACI # from TCS3.2/LoCosto onto the TCS211 foundation. It is based on the # l1reconst config. GPRS=1 MMI=0 SRVC=1 export GPRS MMI SRVC ATP_STATE=0 FCHG_STATE=0 LCC_STATE=0 MKS_STATE=0 PWR_STATE=0 R2D_STATE=0 export ATP_STATE FCHG_STATE LCC_STATE MKS_STATE PWR_STATE R2D_STATE scripts/config-headers-new.sh CONDAT=condat3 GPF=gpf3 CDGINC=cdg-hybrid/cdginc CDGPRIM=cdg-hybrid/sap-inline ACI=g23m-aci export CONDAT GPF CDGINC CDGPRIM ACI build_lib ccddata # ACI libs build_lib aci tcs3 build_lib aciext tcs3 build_lib aci_dti_mng tcs3 build_lib atiext tcs3 build_lib comlib hybrid build_lib config_gprs_fl hybrid build_lib config_gprs_ir hybrid lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' # G23M protocol stack libs build_lib alr sotovik build_lib cc build_lib cci build_lib cci_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib cl build_lib dl build_lib dti build_lib fad build_lib gmm build_lib grlc build_lib grlc_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib grr build_lib l1_pei build_lib l2r build_lib llc build_lib mm build_lib ra build_lib rlp build_lib rr build_lib sim_b_lib build_lib sm build_lib sms build_lib sndcp build_lib ss build_lib t30 build_lib uart_b_lib build_lib ppp build_lib ppp_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib upm # Condat drivers build_lib gdi # GPF build_lib ccd_na7_db blob_lib_gpf frame_na7_db_fl blob_lib_custom blobs/patches/frame_na7_db_ir-systrace.lib frame_na7_db_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' blob_lib_gpf misc_na7_db_fl blob_lib_gpf misc_na7_db_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' blob_lib_gpf osx_na7_db lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' blob_lib_gpf tif_na7_db_fl blob_lib_gpf tif_na7_db_ir lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' # core drivers build_lib drivers_flash # Layer 1 build_lib tpudrv lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib l1_ext lib_link_magic '(BSS_LIBS (.l1s_global))' build_lib l1_int lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib l1_custom_ext build_lib l1_custom_int lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' build_lib riviera_core_flash build_lib riviera_cust_flash # services #build_lib atp build_lib audio build_lib audio_bgd build_lib cst build_lib dar build_lib dar_gbl_var lib_link_magic '(BSS_DAR_LIB (.bss))' build_lib etm build_lib lls #build_lib mks # app drivers build_lib abb build_lib buzzer build_lib ffs build_lib ffs_drv build_lib ffs_pcm build_lib kpd #build_lib lcc build_lib power build_lib rtc_drv build_lib sim_drv build_lib spi_drv build_lib uart_drv # system glue build_lib main init build_lib bootloader lib_link_magic '(CONST_BOOT_LIB (.const, .text, .text:v$3) BSS_BOOT_LIB (.bss))' # Nucleus and TI's compiler stuff blob_lib_os nucleus_flash_nodbg blob_lib_os nucleus_int_ram_nodbg lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))' blob_lib_os rts16le_flash blob_lib_os rts16le_int_ram lib_link_magic '(BSS_LIBS (.bss))' str2ind_blobs_used=0