diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index c66fed8a27985..dadfdd67236dd 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -421,6 +421,11 @@ static int procfs_open(FAR struct file *filep, FAR const char *relpath, if (fnmatch(g_procfs_entries[x].pathpattern, relpath, 0) == 0) { + if (g_procfs_entries[x].type == PROCFS_DIR_TYPE) + { + return -EISDIR; + } + /* Match found! Stat using this procfs entry */ DEBUGASSERT(g_procfs_entries[x].ops &&