Skip to content

Commit

Permalink
Fix oops in acer_wmi driver (acer_wmi_init)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Aug 24, 2008
1 parent 6450f65 commit 83097ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/misc/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 83097ac

Please sign in to comment.