From 5ccbaae150e74260ef0c9b4e5f079bfae35df6fd Mon Sep 17 00:00:00 2001 From: tanek liang Date: Tue, 28 Nov 2017 21:11:41 +0800 Subject: [PATCH] [DFS] fix ROMFS get root directory bug --- components/dfs/filesystems/romfs/dfs_romfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index f88845f41d..c842601dc8 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -191,8 +191,10 @@ int dfs_romfs_open(struct dfs_fd *file) rt_size_t size; struct romfs_dirent *dirent; struct romfs_dirent *root_dirent; + struct dfs_filesystem *fs; - root_dirent = (struct romfs_dirent *)file->data; + fs = (struct dfs_filesystem *)file->data; + root_dirent = (struct romfs_dirent *)fs->data; if (check_dirent(root_dirent) != 0) return -EIO;