Explorar el Código

Free I/O buffers when we are finished with them!

tags/v0.9.3
Michael Brown hace 18 años
padre
commit
6006bed530
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4
    1
      src/core/posix_io.c

+ 4
- 1
src/core/posix_io.c Ver fichero

78
 	struct io_buffer *tmp;
78
 	struct io_buffer *tmp;
79
 
79
 
80
 	list_for_each_entry_safe ( iobuf, tmp, &file->data, list ) {
80
 	list_for_each_entry_safe ( iobuf, tmp, &file->data, list ) {
81
+		list_del ( &iobuf->list );
81
 		free_iob ( iobuf );
82
 		free_iob ( iobuf );
82
 	}
83
 	}
83
 	free ( file );
84
 	free ( file );
279
 			copy_to_user ( buffer, offset, iobuf->data,
280
 			copy_to_user ( buffer, offset, iobuf->data,
280
 				       frag_len );
281
 				       frag_len );
281
 			iob_pull ( iobuf, frag_len );
282
 			iob_pull ( iobuf, frag_len );
282
-			if ( ! iob_len ( iobuf ) )
283
+			if ( ! iob_len ( iobuf ) ) {
284
+				list_del ( &iobuf-> list );
283
 				free_iob ( iobuf );
285
 				free_iob ( iobuf );
286
+			}
284
 			file->pos += frag_len;
287
 			file->pos += frag_len;
285
 			len += frag_len;
288
 			len += frag_len;
286
 			offset += frag_len;
289
 			offset += frag_len;

Loading…
Cancelar
Guardar