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>

authored by Arjan van de Ven and committed by Linus Torvalds 83097aca 6450f651

+5
+5
drivers/misc/acer-wmi.c
··· 192 192 193 193 static void set_quirks(void) 194 194 { 195 + if (!interface) 196 + return; 197 + 195 198 if (quirks->mailled) 196 199 interface->capability |= ACER_CAP_MAILLED; 197 200 ··· 1239 1236 "load\n"); 1240 1237 return -ENODEV; 1241 1238 } 1239 + 1240 + set_quirks(); 1242 1241 1243 1242 if (platform_driver_register(&acer_platform_driver)) { 1244 1243 printk(ACER_ERR "Unable to register platform driver.\n");