Skip to contentSkip to conversation

fix thinkpad_acpi without hardware

2.6.23 regression fix NAK Adrian Bunk 2 participants 2 messages Aug 5, 2007 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

René Treffer reported that booting a CONFIG_THINKPAD_ACPI=y kernel on a machine without the hardware results in an Oops.

The trace is thinkpad_acpi_module_init -> thinkpad_acpi_module_exit -> driver_remove_file -> sysfs_hash_and_remove.

The error handling if thinkpad_acpi_module_init() fails generally looks suspicious, but this patch at least fixes the common case if no hardware was found, and it seems in this case there isn't any cleanup actually required.

Broken by commit d5a2f2f1d68e2da538ac28540cddd9ccc733b001.

---
bfa7bcd2b872f2c20afa7f7260d9be7dffe92d2e

drivers/misc/thinkpad_acpi.c +1 -3
index fa80f35..c7432a7 100644
@@ -4644,10 +4644,8 @@ static int __init thinkpad_acpi_module_init(void)
 
 	get_thinkpad_model_data(&thinkpad_id);
 	ret = probe_for_thinkpad();
-	if (ret) {
-		thinkpad_acpi_module_exit();
+	if (ret)
 		return ret;
-	}
 
 	/* Driver initialization */
 
#1 lore raw
Quoted 6 lines · Adrian Bunk

René Treffer reported that booting a CONFIG_THINKPAD_ACPI=y kernel on a machine without the hardware results in an Oops.

The trace is thinkpad_acpi_module_init -> thinkpad_acpi_module_exit -> driver_remove_file -> sysfs_hash_and_remove.

Quoted 8 lines

The error handling if thinkpad_acpi_module_init() fails generally looks suspicious, but this patch at least fixes the common case if no hardware was found, and it seems in this case there isn't any cleanup actually required.

Broken by commit d5a2f2f1d68e2da538ac28540cddd9ccc733b001.

NAK

Proper fix already sent to Len Brown, and already queued to be pulled by Linus.

Len, that'd be "ACPI: thinkpad-acpi: fix the module init failure path",
http://thread.gmane.org/gmane.linux.acpi.devel/24413

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh