diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index f5619e2354e6154023569b63b79f62ee99f951be..614a34949466f08ebd8789c2c50a6467f8b29423 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -335,6 +335,9 @@ int dfs_file_lseek(struct dfs_fd *fd, rt_off_t offset) if (fd == RT_NULL) return -DFS_STATUS_EINVAL; + fs = fd->fs; + if (fs == RT_NULL) + return -DFS_STATUS_EINVAL; if (fs->ops->lseek == RT_NULL) return -DFS_STATUS_ENOSYS;