[2.6.23 regression fix] fix thinkpad_acpi without hardware

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Henrique de Moraes Holschuh <hmh@...>, Len Brown <len.brown@...>
Cc: <linux-kernel@...>, <ibm-acpi-devel@...>, René <treffer@...>, Michal Piotrowski <michal.k.k.piotrowski@...>
Date: Sunday, August 5, 2007 - 3:53 pm

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.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
bfa7bcd2b872f2c20afa7f7260d9be7dffe92d2e 
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index fa80f35..c7432a7 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -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 */
 

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[2.6.23 regression fix] fix thinkpad_acpi without hardware, Adrian Bunk, (Sun Aug 5, 3:53 pm)
Re: [2.6.23 regression fix] fix thinkpad_acpi without hardware, Henrique de Moraes Holschuh..., (Sun Aug 5, 4:18 pm)