Skip to contentSkip to conversation

panasonic-laptop: beyond ARRAY_SIZE of pcc->keymap

PATCH In review Roel Kluin 3 participants 4 messages May 21, 2009 – May 27, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 panasonic-laptop: beyond ARRAY_SIZE of pcc->keymap

Do not go beyond ARRAY_SIZE of pcc->keymap

---
This is against linux-next

drivers/misc/panasonic-laptop.c +1 -1
index 4a1bc64..d82d1cc 100644
@@ -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));
#1 lore raw
Quoted 3 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of pcc->keymap

Presumably you meant to send this to linux-acpi or linux-kernel instead of linux-sh ;-)

author
#2 lore raw

PATCH 1/1 panasonic-laptop: beyond ARRAY_SIZE of pcc->keymap

Do not go beyond ARRAY_SIZE of pcc->keymap

---

Quoted 2 lines

Presumably you meant to send this to linux-acpi or linux-kernel instead of linux-sh ;-)

I was not sure, but linux-acpi is cc'ed now.

drivers/misc/panasonic-laptop.c +1 -1
index 4a1bc64..d82d1cc 100644
@@ -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));
reviewer
#3 lore raw

This patch already shipped in 2.6.29.

2b190e76def5233c542f6025b4a133b1d4bd1a37
"panasonic-laptop: fix X[ ARRAY_SIZE(X) ]"

thanks,
Len Brown, Intel Open Source Technology Center

Quoted 27 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of pcc->keymap

---

Quoted 2 lines

Presumably you meant to send this to linux-acpi or linux-kernel instead of linux-sh ;-)

I was not sure, but linux-acpi is cc'ed now.

drivers/misc/panasonic-laptop.c +1 -2
index 4a1bc64..d82d1cc 100644
@@ -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));
--

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