summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2014-10-14 16:09:10 +0800
committerGrissiom <[email protected]>2014-10-14 16:09:10 +0800
commit9a755833492a6a81045d987ba44fd7f105d489c3 (patch)
tree00335a371251a7de6a81a5bccf58a61d0cdb7018 /components/dfs/src
parent4c39f8765ac20bd43488484dd3e526de792e5d5e (diff)
dfs: check for null reference
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index f5619e2354..614a349494 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;