diff --git a/components/fs/fs.c b/components/fs/fs.c index a06212a3f4899b06abad994c60e6c8880c48d6f1..636667f9b22d32a64cc0182d30a6db0402bf3944 100644 --- a/components/fs/fs.c +++ b/components/fs/fs.c @@ -347,14 +347,14 @@ ssize_t read(int fd, void *buf, size_t nbyte) return recv(fd, buf, nbyte, 0); } #endif - if (g_fs->fsFops == NULL || g_fs->fsFops->Read == NULL) { - errno = ENOSYS; - return FS_FAILURE; - } if (g_fs == NULL) { errno = ENODEV; return FS_FAILURE; } + if (g_fs->fsFops == NULL || g_fs->fsFops->Read == NULL) { + errno = ENOSYS; + return FS_FAILURE; + } return g_fs->fsFops->Read(fd, buf, nbyte); }