This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 0a1c9d1b07b fs/vfs/fs_rename: remove dead subdir code in mountptrename
0a1c9d1b07b is described below
commit 0a1c9d1b07b86dc335ac180180b6e8c020ad5a8c
Author: anpeiyun <[email protected]>
AuthorDate: Thu Nov 12 21:33:19 2026 +0800
fs/vfs/fs_rename: remove dead subdir code in mountptrename
The 'subdir' variable in mountptrename() is initialized to NULL and
never reassigned, making the 'subdir != NULL' check and subsequent
fs_heap_free() call dead code. Remove the variable declaration and
the unreachable cleanup block to eliminate the unsatisfiable MC/DC
branch.
Signed-off-by: anpeiyun <[email protected]>
Signed-off-by: jingfei <[email protected]>
---
fs/vfs/fs_rename.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/fs/vfs/fs_rename.c b/fs/vfs/fs_rename.c
index 62c60892caa..dad2d290c54 100644
--- a/fs/vfs/fs_rename.c
+++ b/fs/vfs/fs_rename.c
@@ -301,7 +301,6 @@ static int mountptrename(FAR const char *oldpath, FAR
struct inode *oldinode,
struct inode_search_s newdesc;
FAR struct inode *newinode;
FAR const char *newrelpath;
- FAR char *subdir = NULL;
bool newexists = false;
bool newisdir = false;
bool oldisdir = false;
@@ -526,10 +525,6 @@ errout_with_newinode:
errout_with_newsearch:
inode_search_release(&newdesc);
- if (subdir != NULL)
- {
- fs_heap_free(subdir);
- }
return ret;
}