]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.arch/thinkpad_acpi-hotkey-notify-fix
Merge branch 'master' into next
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.arch / thinkpad_acpi-hotkey-notify-fix
1 From: Jeff Mahoney <jeffm@suse.com>
2 Subject: [PATCH] thinkpad_acpi: Fix oops with incompatible backlight interface
3
4 Mainline commit 2dba1b5d87e08a294da5cdfa4d32908000e9b085 (trenn's patch
5 thinkpad_fingers_off_backlight_igd.patch added new users of
6 ibm_backlight_device.
7
8 brightness_init() returns -errno on fatal errors and 1 if the interface
9 is incompatible. This leaves ibm_backlight_device == NULL, which causes
10 an oops in hotkey_notify().
11
12 This patch adds a check for ibm_backlight_device.
13
14 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
15 ---
16 drivers/misc/thinkpad_acpi.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/misc/thinkpad_acpi.c
20 +++ b/drivers/misc/thinkpad_acpi.c
21 @@ -2401,7 +2401,7 @@ static void hotkey_notify(struct ibm_str
22 case 1:
23 /* 0x1000-0x1FFF: key presses */
24 scancode = hkey & 0xfff;
25 - if (tp_features.bright_igdmode) {
26 + if (tp_features.bright_igdmode && ibm_backlight_device) {
27 /* ToDo:
28 * Is there an already defined key?
29 */