From 56c0df1e58a231750ebfbc93401a4b6f42f99ffb Mon Sep 17 00:00:00 2001 From: shaojinchun Date: Mon, 10 Dec 2018 08:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3dfs=E5=9C=A8fd=5Fget=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E6=A3=80=E6=9F=A5=E6=9C=89=E6=95=88=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/src/dfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;