ACPI: thinkpad-acpi: fix oops when a module parameter has no value
commita0347c85d36b2cb384eefe37cbfa5f8adca86b11
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 18 Nov 2007 02:15:55 +0000 (18 00:15 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 26 Feb 2008 02:34:08 +0000 (25 23:34 -0300)
tree38ea5e3c434feb7a094fcc0f4dd8aee47019b541
parentc7370dfe1ce71a9e16685b4f8ae85219b3fea732
ACPI: thinkpad-acpi: fix oops when a module parameter has no value

set_ibm_param() could OOPS with a NULL pointer derreference if one did not give
any values for a module parameter it handles.  This would, of course, cause all
sort of trouble for future modprobing and require a reboot to clean up
properly.

Fix it by returning -EINVAL if no values are given for the parameter, and also
avoid any nastyness from BUG_ON while at it.

How to reproduce: modprobe thinkpad-acpi brightness

Error report by Mike Kershaw.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
drivers/misc/thinkpad_acpi.c