Skip to content

Commit 83097ac

Browse files
fenrus75torvalds
authored andcommitted
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 <[email protected]> CC: [email protected] Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6450f65 commit 83097ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/misc/acer-wmi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ static struct quirk_entry *quirks;
192192

193193
static void set_quirks(void)
194194
{
195+
if (!interface)
196+
return;
197+
195198
if (quirks->mailled)
196199
interface->capability |= ACER_CAP_MAILLED;
197200

@@ -1237,6 +1240,8 @@ static int __init acer_wmi_init(void)
12371240
return -ENODEV;
12381241
}
12391242

1243+
set_quirks();
1244+
12401245
if (platform_driver_register(&acer_platform_driver)) {
12411246
printk(ACER_ERR "Unable to register platform driver.\n");
12421247
goto error_platform_register;

0 commit comments

Comments
 (0)