From 95e4561145f626420bd03b81efe8e3beb9fd75e1 Mon Sep 17 00:00:00 2001 From: aineoae86-sys Date: Mon, 6 Jul 2026 04:05:05 +0800 Subject: [PATCH] tools: rp2040: Drop uninitialized name length check scan_dir() checked name_len before assigning it. Directory entries already compute and validate strlen(a_dirent->d_name) before allocating the dir item, while the root path passed to scan_dir() is not encoded as a directory entry name. Remove the stale pre-opendir check so scan_dir() no longer branches on an uninitialized local variable. Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys --- tools/rp2040/make_flash_fs.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/rp2040/make_flash_fs.c b/tools/rp2040/make_flash_fs.c index ba2b0e0007e..190d4293b89 100644 --- a/tools/rp2040/make_flash_fs.c +++ b/tools/rp2040/make_flash_fs.c @@ -237,12 +237,6 @@ int scan_dir(int in_sector) struct stat stat; int name_len; - if (name_len > max_name_len) - { - fprintf(stderr, "directory name to big. skipped. (%s)\n", path); - return -1; - } - input_dir = opendir(path); if (input_dir == NULL)