diff mbox

panasonic-laptop: beyond ARRAY_SIZE of pcc->keymap

Message ID 4A15B5CA.9060907@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Roel Kluin May 21, 2009, 8:12 p.m. UTC
Do not go beyond ARRAY_SIZE of pcc->keymap

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This is against linux-next


--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Paul Mundt May 22, 2009, 2:19 a.m. UTC | #1
On Thu, May 21, 2009 at 10:12:58PM +0200, Roel Kluin wrote:
> Do not go beyond ARRAY_SIZE of pcc->keymap
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Presumably you meant to send this to linux-acpi or linux-kernel instead
of linux-sh ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/misc/panasonic-laptop.c b/drivers/misc/panasonic-laptop.c
index 4a1bc64..d82d1cc 100644
--- a/drivers/misc/panasonic-laptop.c
+++ b/drivers/misc/panasonic-laptop.c
@@ -515,7 +515,7 @@  static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
 
 	hkey_num = result & 0xf;
 
-	if (hkey_num < 0 || hkey_num > ARRAY_SIZE(pcc->keymap)) {
+	if (hkey_num < 0 || hkey_num >= ARRAY_SIZE(pcc->keymap)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
 				  "hotkey number out of range: %d\n",
 				  hkey_num));