diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index b091b20a98b..6ccd9f722a8 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -186,6 +186,7 @@ int exec_module(FAR const struct binary_s *binp) { ret = -get_errno(); berr("task_init() failed: %d\n", ret); + kumm_free(stack); goto errout_with_addrenv; } diff --git a/binfmt/libelf/libelf_init.c b/binfmt/libelf/libelf_init.c index 97be242197f..11223f75e36 100644 --- a/binfmt/libelf/libelf_init.c +++ b/binfmt/libelf/libelf_init.c @@ -176,6 +176,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) if (ret < 0) { berr("Failed to read ELF header: %d\n", ret); + close(loadinfo->filfd); return ret; } @@ -194,6 +195,7 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo) */ berr("Bad ELF header: %d\n", ret); + close(loadinfo->filfd); return ret; } diff --git a/drivers/mtd/smart.c b/drivers/mtd/smart.c index 68debd681e3..ecd8a1a8f5b 100644 --- a/drivers/mtd/smart.c +++ b/drivers/mtd/smart.c @@ -4988,7 +4988,7 @@ static inline int smart_allocsector(FAR struct smart_struct_s *dev, physicalsector = smart_findfreephyssector(dev, FALSE); finfo("Alloc: log=%d, phys=%d, erase block=%d, free=%d, released=%d\n", logsector, physicalsector, physicalsector / - dev->sectorsPerBlk, dev->freesectors, dev->releasecount); + dev->sectorsPerBlk, dev->freesectors, dev->releasesectors); if (physicalsector == 0xffff) { diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 81c8630abe4..b805d0757ef 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -268,6 +268,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, if (ret < 0) { ferr("ERROR: Failed to locate start of file data: %d\n", ret); + kmm_free(rf); goto errout_with_semaphore; } @@ -277,6 +278,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, if (ret < 0) { ferr("ERROR: Failed configure buffering: %d\n", ret); + kmm_free(rf); goto errout_with_semaphore; } diff --git a/libs/libc/math/lib_tanh.c b/libs/libc/math/lib_tanh.c index 4cbaf3d7d50..85dce6df5f6 100644 --- a/libs/libc/math/lib_tanh.c +++ b/libs/libc/math/lib_tanh.c @@ -44,6 +44,6 @@ double tanh(double x) double x0 = exp(x); double x1 = 1.0 / x0; - return ((x0 + x1) / (x0 - x1)); + return ((x0 - x1) / (x0 + x1)); } #endif diff --git a/libs/libc/math/lib_tanhf.c b/libs/libc/math/lib_tanhf.c index e3df3774b7e..8db236abf8f 100644 --- a/libs/libc/math/lib_tanhf.c +++ b/libs/libc/math/lib_tanhf.c @@ -40,5 +40,5 @@ float tanhf(float x) float x0 = expf(x); float x1 = 1.0F / x0; - return ((x0 + x1) / (x0 - x1)); + return ((x0 - x1) / (x0 + x1)); } diff --git a/libs/libc/math/lib_tanhl.c b/libs/libc/math/lib_tanhl.c index 4303ea178e8..a03c000ef7d 100644 --- a/libs/libc/math/lib_tanhl.c +++ b/libs/libc/math/lib_tanhl.c @@ -44,6 +44,6 @@ long double tanhl(long double x) long double x0 = exp(x); long double x1 = 1.0 / x0; - return ((x0 + x1) / (x0 - x1)); + return ((x0 - x1) / (x0 + x1)); } #endif diff --git a/sched/clock/clock_initialize.c b/sched/clock/clock_initialize.c index 011f514f47f..116b0bc877c 100644 --- a/sched/clock/clock_initialize.c +++ b/sched/clock/clock_initialize.c @@ -175,9 +175,7 @@ static void clock_inittime(void) /* (Re-)initialize the time value to match the RTC */ #ifndef CONFIG_CLOCK_TIMEKEEPING -#ifndef CONFIG_RTC_HIRES clock_basetime(&g_basetime); -#endif #ifndef CONFIG_SCHED_TICKLESS g_system_timer = INITIAL_SYSTEM_TIMER_TICKS; diff --git a/sched/group/group_create.c b/sched/group/group_create.c index 6f6afaacc19..67eb186ff2b 100644 --- a/sched/group/group_create.c +++ b/sched/group/group_create.c @@ -343,6 +343,7 @@ int group_initialize(FAR struct task_tcb_s *tcb) if (!group->tg_members) { kmm_free(group); + tcb->cmn.group = NULL; return -ENOMEM; }