diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 627d03e0e12..c5958fb318a 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -714,8 +714,12 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath, * derived from struct procfs_dir_priv_s as dir. */ - DEBUGASSERT(g_procfs_entries[x].ops != NULL && - g_procfs_entries[x].ops->opendir != NULL); + DEBUGASSERT(g_procfs_entries[x].ops != NULL); + + if (g_procfs_entries[x].ops->opendir == NULL) + { + return -ENOENT; + } ret = g_procfs_entries[x].ops->opendir(relpath, dir); if (ret == OK)