You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/02/25 07:42:13 UTC
[incubator-nuttx] branch master updated (8085010 -> 542574a)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from 8085010 arch: arm: Add 'select ARM_HAVE_WFE_SEV' to ARCH_CHIP_RP2040
new bac6b11 sched/module/mod_insmod.c: Fix a resource leak
new 542574a libs/libc/modlib/modlib_init.c: initialize file descriptor with -1
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
libs/libc/modlib/modlib_init.c | 1 +
sched/module/mod_insmod.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
[incubator-nuttx] 02/02: libs/libc/modlib/modlib_init.c: initialize
file descriptor with -1
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 542574acd61033e92f46ebe15c7d5d8991740b80
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Feb 25 13:54:44 2021 +0900
libs/libc/modlib/modlib_init.c: initialize file descriptor with -1
Use -1 instead of 0 to represent an invalid descriptor
so that modlib_uninitialize doesn't try to close the descriptor 0.
---
libs/libc/modlib/modlib_init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libs/libc/modlib/modlib_init.c b/libs/libc/modlib/modlib_init.c
index 4b14196..aa1b0f6 100644
--- a/libs/libc/modlib/modlib_init.c
+++ b/libs/libc/modlib/modlib_init.c
@@ -132,6 +132,7 @@ int modlib_initialize(FAR const char *filename,
/* Clear the load info structure */
memset(loadinfo, 0, sizeof(struct mod_loadinfo_s));
+ loadinfo->filfd = -1;
/* Get the length of the file. */
[incubator-nuttx] 01/02: sched/module/mod_insmod.c: Fix a resource
leak
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit bac6b11065c90de881c1e9cc8ad341d64a1ba225
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Thu Feb 25 13:53:20 2021 +0900
sched/module/mod_insmod.c: Fix a resource leak
Note: partially initialized loadinfo should be uninitialized.
It can contain an open file descriptor.
---
sched/module/mod_insmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c
index 6e062f3..b94d080 100644
--- a/sched/module/mod_insmod.c
+++ b/sched/module/mod_insmod.c
@@ -185,7 +185,7 @@ FAR void *insmod(FAR const char *filename, FAR const char *modname)
if (ret != 0)
{
berr("ERROR: Failed to initialize to load module: %d\n", ret);
- goto errout_with_lock;
+ goto errout_with_loadinfo;
}
/* Allocate a module registry entry to hold the module data */