diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index 0f69ad2e3ec9fb7a31affd34514f466aaeb5f8a1..04d862e85db2164cac72ad6f3c543c5845037c1c 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -444,7 +444,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) /* lock file system */ dfs_lock(); /* find the file system operations */ - for (index = 0; index <= DFS_FILESYSTEM_TYPES_MAX; index ++) + for (index = 0; index < DFS_FILESYSTEM_TYPES_MAX; index ++) { if (filesystem_operation_table[index] != NULL && strcmp(filesystem_operation_table[index]->name, fs_name) == 0) @@ -452,7 +452,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name) } dfs_unlock(); - if (index <= DFS_FILESYSTEM_TYPES_MAX) + if (index < DFS_FILESYSTEM_TYPES_MAX) { /* find file system operation */ const struct dfs_filesystem_ops *ops = filesystem_operation_table[index];