fs/files_allocate: assert when fd overflow

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-02-18 20:28:04 +08:00 committed by Xiang Xiao
parent ad9ba8f454
commit 66d854371b
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ static int files_extend(FAR struct filelist *list, size_t row)
list->fl_files = tmp;
list->fl_rows = row;
/* Note: If assertion occurs, the fl_rows has a overflow.
* And there may be file descriptors leak in system.
*/
DEBUGASSERT(list->fl_rows == row);
return 0;
}