diff mbox

fix X[ ARRAY_SIZE(X) ]

Message ID 4971F06F.9030309@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Roel Kluin Jan. 17, 2009, 2:51 p.m. UTC
Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Len Brown Jan. 18, 2009, 1:20 a.m. UTC | #1
applied

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

On Sat, 17 Jan 2009, Roel Kluin wrote:

> Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
> index f30db36..c47a44d 100644
> --- a/drivers/platform/x86/panasonic-laptop.c
> +++ b/drivers/platform/x86/panasonic-laptop.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" 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/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index f30db36..c47a44d 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -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));