From a9548b8c39545eee4c41d659c29d4ee188712960 Mon Sep 17 00:00:00 2001 From: Vladimir Umek Date: Thu, 27 Aug 2026 14:33:36 +0200 Subject: [PATCH 1/2] FileSystem: correct fchdrive to correctly handle NULL argument --- Components/FileSystem/FileSystem.scvd | 2 +- Components/FileSystem/Include/rl_fs.h | 2 +- Components/FileSystem/Source/fs_mapi.c | 22 +++++++++---------- .../FileSystem/src/revision_history.md | 1 + .../Doxygen/General/src/revision_history.md | 2 +- Keil.MDK-Middleware.pdsc | 5 +++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Components/FileSystem/FileSystem.scvd b/Components/FileSystem/FileSystem.scvd index d368ac6c..35fe8129 100644 --- a/Components/FileSystem/FileSystem.scvd +++ b/Components/FileSystem/FileSystem.scvd @@ -1,7 +1,7 @@ - + diff --git a/Components/FileSystem/Include/rl_fs.h b/Components/FileSystem/Include/rl_fs.h index eb83d7c5..9b6b8ab7 100644 --- a/Components/FileSystem/Include/rl_fs.h +++ b/Components/FileSystem/Include/rl_fs.h @@ -14,7 +14,7 @@ #define MW_FS_VERSION_MAJOR 8 #define MW_FS_VERSION_MINOR 0 -#define MW_FS_VERSION_PATCH 6 +#define MW_FS_VERSION_PATCH 7 // ==== Enumeration, structures, defines ==== diff --git a/Components/FileSystem/Source/fs_mapi.c b/Components/FileSystem/Source/fs_mapi.c index 39f59597..87e6244c 100644 --- a/Components/FileSystem/Source/fs_mapi.c +++ b/Components/FileSystem/Source/fs_mapi.c @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------------ * MDK Middleware - Component ::File System - * Copyright (c) 2004-2025 Arm Limited (or its affiliates). All rights reserved. + * Copyright (c) 2004-2026 Arm Limited (or its affiliates). All rights reserved. *------------------------------------------------------------------------------ * Name: fs_mapi.c * Purpose: File Maintenance API Functions @@ -987,21 +987,19 @@ fsStatus fchdir (const char *path) { */ fsStatus fchdrive (const char *drive) { int32_t id; + fsStatus status; EvrFsCore_fchdrive (drive); - if (drive[0] == '\0') { - /* Empty string is not allowed */ - return (fsInvalidParameter); - } - else { - id = fs_drive_id (drive, NULL); - if (id < 0) { - /* Nonexistent drive or invalid input */ - return ((fsStatus)(-id)); - } + id = fs_drive_id (drive, NULL); + if (id < 0) { + /* Nonexistent drive or invalid input */ + status = (fsStatus)(-id); + } else { + status = fs_set_cdrive (id); } - return (fs_set_cdrive (id)); + + return status; } diff --git a/Documentation/Doxygen/FileSystem/src/revision_history.md b/Documentation/Doxygen/FileSystem/src/revision_history.md index 6ce9334d..d8049456 100644 --- a/Documentation/Doxygen/FileSystem/src/revision_history.md +++ b/Documentation/Doxygen/FileSystem/src/revision_history.md @@ -8,6 +8,7 @@ V8.0.6 + - corrected fchdrive to correctly handle NULL argument - corrected funmount for FAT drives when called multiple times - corrected FAT name cache entry size from 48 to 40 bytes - corrected various minor code quality issues diff --git a/Documentation/Doxygen/General/src/revision_history.md b/Documentation/Doxygen/General/src/revision_history.md index e866ba66..b82795c7 100644 --- a/Documentation/Doxygen/General/src/revision_history.md +++ b/Documentation/Doxygen/General/src/revision_history.md @@ -13,7 +13,7 @@ V8.3.1 - Network Component Version 8.3.1 - - FileSystem Component Version 8.0.6 + - FileSystem Component Version 8.0.7 - USB Component Version 8.0.2 (unchanged) diff --git a/Keil.MDK-Middleware.pdsc b/Keil.MDK-Middleware.pdsc index 20178ba1..6f4fbbc7 100644 --- a/Keil.MDK-Middleware.pdsc +++ b/Keil.MDK-Middleware.pdsc @@ -14,7 +14,8 @@ Active development ... - FileSystem Component Version 8.0.6 + FileSystem Component Version 8.0.7 + - corrected fchdrive to correctly handle NULL argument - corrected funmount for FAT drives when called multiple times - corrected FAT name cache entry size from 48 to 40 bytes - corrected various minor code quality issues @@ -1164,7 +1165,7 @@ - + File Access on various storage devices Documentation/html/FileSystem/index.html From 30b68c22739ac0686b90a91c7695fc65b14c3da0 Mon Sep 17 00:00:00 2001 From: Vladimir Umek Date: Thu, 27 Aug 2026 14:47:41 +0200 Subject: [PATCH 2/2] Bump version --- Documentation/Doxygen/FileSystem/src/revision_history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Doxygen/FileSystem/src/revision_history.md b/Documentation/Doxygen/FileSystem/src/revision_history.md index d8049456..77268e1a 100644 --- a/Documentation/Doxygen/FileSystem/src/revision_history.md +++ b/Documentation/Doxygen/FileSystem/src/revision_history.md @@ -6,7 +6,7 @@ Description - V8.0.6 + V8.0.7 - corrected fchdrive to correctly handle NULL argument - corrected funmount for FAT drives when called multiple times