fs: Skip call fs_checkfd if fd < 3 in fs_fdopen
since the stdin, stdout and stderr may initialize later in userspace if CONFIG_DEV_CONSOLE isn't enabled. Note: it isn't bigger issue here to skip the check because vfs will check the validation again in read and write syscall Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
e1596e80aa
commit
29c6f11239
@ -115,7 +115,7 @@ int fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb,
|
||||
{
|
||||
FAR struct streamlist *slist;
|
||||
FAR FILE *stream;
|
||||
int ret;
|
||||
int ret = OK;
|
||||
|
||||
/* Check input parameters */
|
||||
|
||||
@ -164,7 +164,7 @@ int fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb,
|
||||
* more checks.
|
||||
*/
|
||||
|
||||
else
|
||||
else if (fd >= 3)
|
||||
{
|
||||
ret = fs_checkfd(tcb, fd, oflags);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user