diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-03-11 05:36:07 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-03-14 15:00:19 -0400 |
commit | 741d98c733b6605fc621c5c8740c7120ae1c0006 (patch) | |
tree | 926eb28f569a2ffa67e78b09eb4d4ddb7df8ee27 /drivers/platform/x86 | |
parent | abf9dc0d9ae813d425675656f1af16f58c60e443 (diff) |
thinkpad_acpi: off by one in adaptive_keyboard_hotkey_notify_hotkey()
This should be >= instead of > because otherwise we read one element
past the end of the hotkey_keycode_map[] array.
The hotkey_keycode_map[] array has TPACPI_HOTKEY_MAP_LEN elements.
Fixes: 6a68d8557084 ('thinkpad_acpi: Add support for more adaptive kbd buttons')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-By: Bastien Nocera <hadess@hadess.net>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 024861db1587..7769575345d8 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -3656,8 +3656,9 @@ static bool adaptive_keyboard_hotkey_notify_hotkey(unsigned int scancode) | |||
3656 | return true; | 3656 | return true; |
3657 | 3657 | ||
3658 | default: | 3658 | default: |
3659 | if (scancode < FIRST_ADAPTIVE_KEY || scancode > FIRST_ADAPTIVE_KEY + | 3659 | if (scancode < FIRST_ADAPTIVE_KEY || |
3660 | TPACPI_HOTKEY_MAP_LEN - ADAPTIVE_KEY_OFFSET) { | 3660 | scancode >= FIRST_ADAPTIVE_KEY + TPACPI_HOTKEY_MAP_LEN - |
3661 | ADAPTIVE_KEY_OFFSET) { | ||
3661 | pr_info("Unhandled adaptive keyboard key: 0x%x\n", | 3662 | pr_info("Unhandled adaptive keyboard key: 0x%x\n", |
3662 | scancode); | 3663 | scancode); |
3663 | return false; | 3664 | return false; |