diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index b039051bb7359..6407f0eb9bd30 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -104,7 +104,7 @@ static int fdlist_extend(FAR struct fdlist *list, size_t row) return 0; } - if (CONFIG_NFILE_DESCRIPTORS_PER_BLOCK * (orig_rows + 1) > OPEN_MAX) + if (CONFIG_NFILE_DESCRIPTORS_PER_BLOCK * row > OPEN_MAX) { fdlist_dump(list); return -EMFILE;