File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -90,33 +90,32 @@ static int files_extend(FAR struct filelist *list, size_t row)
90
90
int i ;
91
91
int j ;
92
92
93
- if (row <= list -> fl_rows )
93
+ orig_rows = list -> fl_rows ;
94
+ if (row <= orig_rows )
94
95
{
95
96
return 0 ;
96
97
}
97
98
98
- if (files_countlist ( list ) > OPEN_MAX )
99
+ if (CONFIG_NFILE_DESCRIPTORS_PER_BLOCK * orig_rows > OPEN_MAX )
99
100
{
100
101
return - EMFILE ;
101
102
}
102
103
103
- orig_rows = list -> fl_rows ;
104
-
105
104
files = kmm_malloc (sizeof (FAR struct file * ) * row );
106
105
DEBUGASSERT (files );
107
106
if (files == NULL )
108
107
{
109
108
return - ENFILE ;
110
109
}
111
110
112
- i = list -> fl_rows ;
111
+ i = orig_rows ;
113
112
do
114
113
{
115
114
files [i ] = kmm_zalloc (sizeof (struct file ) *
116
115
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK );
117
116
if (files [i ] == NULL )
118
117
{
119
- while (-- i >= list -> fl_rows )
118
+ while (-- i >= orig_rows )
120
119
{
121
120
kmm_free (files [i ]);
122
121
}
You can’t perform that action at this time.
0 commit comments