From 1f854486c38dab34f8d2a69df7b1456ebdc7499e Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 21 Jun 2022 20:16:29 +0800 Subject: [PATCH] procfs: procfs_opendir should return fail if can't match Signed-off-by: ligd --- fs/procfs/fs_procfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 0c69f8addb..f9e5aa06dd 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -664,6 +664,11 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, break; } } + + if (x == g_procfs_entrycount) + { + return -ENOENT; + } } dir->u.procfs = priv;