Skip to contentSkip to conversation

x86: left over fix for leak of early_ioremp

PATCH Applied Yinghai Lu 2 participants 2 messages Jan 17, 2008

Subsystems (2)
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: left over fix for leak of early_ioremp

[PATCH] x86: left over fix for leak of early_ioremp

drivers/acpi/tables.c +4 -1
Index: linux-2.6/drivers/acpi/tables.c
===================================================================
@@ -206,8 +206,10 @@ acpi_table_parse_entries(char *id,
 	       table_end) {
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
-			if (handler(entry, table_end))
+			if (handler(entry, table_end)) {
+				acpi_os_unmap_memory(table_header, table_header->length);
 				return -EINVAL;
+			}
 
 		entry = (struct acpi_subtable_header *)
 		    ((unsigned long)entry + entry->length);
@@ -282,6 +285,7 @@ static void __init check_multiple_madt(v
 		       "notify [email protected]\n",
 		       acpi_apic_instance ? 0 : 2);
 
+		acpi_os_unmap_memory(table, table->length);
 	} else
 		acpi_apic_instance = 0;
 
drivers/firmware/dmi_scan.c +1 -0
Index: linux-2.6/drivers/firmware/dmi_scan.c
===================================================================
@@ -353,6 +353,7 @@ void __init dmi_scan_machine(void)
 				return;
 			}
 		}
+		dmi_iounmap(p, 0x10000);
 	}
  out:	printk(KERN_INFO "DMI not present or invalid.\n");
 }
Applied
#1 lore raw

drivers/acpi/tables.c acpi_table_parse_entries(char *id,

Quoted 11 lines · Yinghai Lu
drivers/acpi/tables.c +5 -1
 		    && (!max_entries || count++ < max_entries))
-			if (handler(entry, table_end))
+			if (handler(entry, table_end)) {
+				acpi_os_unmap_memory(table_header, table_header->length);
 				return -EINVAL;
+			}
 
+		acpi_os_unmap_memory(table, table->length);
 
 		}
+		dmi_iounmap(p, 0x10000);

thanks, applied.

Ingo