Fix oops in acer_wmi

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arjan van de Ven
Date: Saturday, August 23, 2008 - 2:05 pm

In the current kerneloops.org stats, acer_wmi is pretty high on the
list for 2.6.27-rc:
http://www.kerneloops.org/search.php?search=acer_wmi_init

this is due to a null pointer due to a misordered initialization...
when the DMI quirks get run, the "interface" variable might not have been initialized.
The patch below 1) prevents the oops and 2) runs the quirks again after all the "interface"
initialization has completed.

This oops is new in 2.6.27-rc and thus counts as a regression...


--- linux.trees.git/drivers/misc/acer-wmi.c~	2008-08-23 13:59:22.000000000 -0700
+++ linux.trees.git/drivers/misc/acer-wmi.c	2008-08-23 14:00:32.000000000 -0700
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
 
 static void set_quirks(void)
 {
+	if (!interface)
+		return;
+
 	if (quirks->mailled)
 		interface->capability |= ACER_CAP_MAILLED;
 
@@ -1237,6 +1240,8 @@ static int __init acer_wmi_init(void)
 		return -ENODEV;
 	}
 
+	set_quirks();
+
 	if (platform_driver_register(&acer_platform_driver)) {
 		printk(ACER_ERR "Unable to register platform driver.\n");
 		goto error_platform_register;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Fix oops in acer_wmi, Arjan van de Ven, (Sat Aug 23, 2:05 pm)
Re: Fix oops in acer_wmi, Carlos Corbacho, (Sat Aug 23, 6:19 pm)
Re: Fix oops in acer_wmi, Arjan van de Ven, (Sat Aug 23, 9:45 pm)
Re: Fix oops in acer_wmi, Carlos Corbacho, (Sun Aug 24, 1:38 am)