aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-08-24 00:45:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-24 00:54:00 -0400
commit83097aca8567a0bd593534853b71fe0fa9a75d69 (patch)
tree67e6c59742c26b9da073c7fea389d7ac0de4bc46
parent6450f65168bcf3c03b5fb44c2fe96682c0d3086b (diff)
Fix oops in acer_wmi driver (acer_wmi_init)
The acer_wmi driver does a DMI scan for quirks, and then sets flags into the "interface" datastructure for some cases. However, the quirks happen real early before "interface" is per se initialized from NULL. The patch below 1) adds a NULL pointer check and 2) (re)runs the quirks at the end, when "interface" has it's final value. Reported-by: kerneloops.org Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk> CC: stable@vger.kernel.org Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/misc/acer-wmi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index b2d9878dc3f0..c6c77a505ec1 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
192 192
193static void set_quirks(void) 193static void set_quirks(void)
194{ 194{
195 if (!interface)
196 return;
197
195 if (quirks->mailled) 198 if (quirks->mailled)
196 interface->capability |= ACER_CAP_MAILLED; 199 interface->capability |= ACER_CAP_MAILLED;
197 200
@@ -1237,6 +1240,8 @@ static int __init acer_wmi_init(void)
1237 return -ENODEV; 1240 return -ENODEV;
1238 } 1241 }
1239 1242
1243 set_quirks();
1244
1240 if (platform_driver_register(&acer_platform_driver)) { 1245 if (platform_driver_register(&acer_platform_driver)) {
1241 printk(ACER_ERR "Unable to register platform driver.\n"); 1246 printk(ACER_ERR "Unable to register platform driver.\n");
1242 goto error_platform_register; 1247 goto error_platform_register;