diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 01f5f9ccc3..fbc0899d36 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -529,7 +529,7 @@ int list_fd(void) { struct dfs_fd *fd = fd_table->fds[index]; - if (fd->fops) + if (fd != RT_NULL) { rt_kprintf("%2d ", index); if (fd->type == FT_DIRECTORY) rt_kprintf("%-7.7s ", "dir");