Skip to contentSkip to conversation

fix X[ ARRAY_SIZE(X) ]

PATCH Applied Roel Kluin 2 participants 2 messages Jan 17, 2009 – Jan 18, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 fix X[ ARRAY_SIZE(X) ]

Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.

---

drivers/platform/x86/panasonic-laptop.c +1 -1
index f30db36..c47a44d 100644
@@ -507,7 +507,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 Applied
#1 lore raw

applied

thanks,
--
Len Brown, Intel Open Source Technology Center

Quoted 22 lines · Roel Kluin

Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.

---

drivers/platform/x86/panasonic-laptop.c +1 -2
index f30db36..c47a44d 100644
@@ -507,7 +507,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