summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/dfs/src/dfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index 38a1813421..cf0b2b0ef9 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -221,7 +221,7 @@ struct dfs_fd *fd_get(int fd)
d = fdt->fds[fd];
/* check dfs_fd valid or not */
- if (d->magic != DFS_FD_MAGIC)
+ if ((d == NULL) || (d->magic != DFS_FD_MAGIC))
{
dfs_unlock();
return NULL;