From: Hrvoje H. <hrv...@zg...> - 2003-09-15 18:50:34
|
Hi! Following patch make acpi_ut_free_and_track function to CHECK address BEFORE deallocating it. Hrvoje --- /usr/src/linux-2.4.22/drivers/acpi/utilities/utalloc.c 2003-08-25 13:44:41.000000000 +0200 +++ utalloc.c 2003-09-15 20:46:37.000000000 +0200 @@ -564,7 +562,7 @@ char *module, u32 line) { - struct acpi_debug_mem_block *debug_block; + struct acpi_debug_mem_block *debug_block,*element; acpi_status status; @@ -581,6 +579,13 @@ debug_block = ACPI_CAST_PTR (struct acpi_debug_mem_block, (((char *) allocation) - sizeof (struct acpi_debug_mem_header))); + element = acpi_ut_find_allocation (ACPI_MEM_LIST_GLOBAL, debug_block); + if( element == NULL ) + { + ACPI_REPORT_ERROR (("Trying to free unallocated segment\n")) + return_VOID; + } + acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].total_freed++; acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].current_total_size -= debug_block->size; |