summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-10-31 09:53:22 +0800
committerbernard <[email protected]>2017-10-31 09:53:22 +0800
commitbc2abf69e2677f5c5591ef7d5a9633f6a1661839 (patch)
treea5055ac22e2f68319ee264e95592b587a9f924b9 /components
parent7d673f921c5c3d31b492ed1506a2f60ab2efda40 (diff)
[DFS] Fix the ramfs issue.
Diffstat (limited to 'components')
-rw-r--r--components/dfs/filesystems/ramfs/dfs_ramfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.c b/components/dfs/filesystems/ramfs/dfs_ramfs.c
index ea9c086cfa..e877e921d2 100644
--- a/components/dfs/filesystems/ramfs/dfs_ramfs.c
+++ b/components/dfs/filesystems/ramfs/dfs_ramfs.c
@@ -311,12 +311,13 @@ int dfs_ramfs_getdents(struct dfs_fd *file,
struct dfs_ramfs *ramfs;
dirent = (struct ramfs_dirent *)file->data;
- if (dirent != &(ramfs->root))
- return -EINVAL;
ramfs = dirent->fs;
RT_ASSERT(ramfs != RT_NULL);
+ if (dirent != &(ramfs->root))
+ return -EINVAL;
+
/* make integer count */
count = (count / sizeof(struct dirent));
if (count == 0)