public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] sony-laptop.c: fix off-by-one
@ 2008-02-19 22:59 Adrian Bunk
  2008-02-19 23:27 ` Mattia Dongili
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-02-19 22:59 UTC (permalink / raw)
  To: Mattia Dongili, Len Brown; +Cc: linux-acpi, linux-kernel

This patch fixes an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/misc/sony-laptop.c.old	2008-02-20 00:26:21.000000000 +0200
+++ linux-2.6/drivers/misc/sony-laptop.c	2008-02-20 00:26:38.000000000 +0200
@@ -314,9 +314,9 @@ static void sony_laptop_report_input_eve
 		kp.dev = jog_dev;
 		break;
 
 	default:
-		if (event > ARRAY_SIZE(sony_laptop_input_index)) {
+		if (event >= ARRAY_SIZE(sony_laptop_input_index)) {
 			dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
 			break;
 		}
 		if (sony_laptop_input_index[event] != -1) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.6 patch] sony-laptop.c: fix off-by-one
  2008-02-19 22:59 [2.6 patch] sony-laptop.c: fix off-by-one Adrian Bunk
@ 2008-02-19 23:27 ` Mattia Dongili
  2008-02-21  9:58   ` Len Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Mattia Dongili @ 2008-02-19 23:27 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Len Brown, linux-acpi, linux-kernel

On Wed, Feb 20, 2008 at 12:59:03AM +0200, Adrian Bunk wrote:
> This patch fixes an off-by-one spotted by the Coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

Acked-by: Mattia Dongili <malattia@linux.it>

> ---
> --- linux-2.6/drivers/misc/sony-laptop.c.old	2008-02-20 00:26:21.000000000 +0200
> +++ linux-2.6/drivers/misc/sony-laptop.c	2008-02-20 00:26:38.000000000 +0200
> @@ -314,9 +314,9 @@ static void sony_laptop_report_input_eve
>  		kp.dev = jog_dev;
>  		break;
>  
>  	default:
> -		if (event > ARRAY_SIZE(sony_laptop_input_index)) {
> +		if (event >= ARRAY_SIZE(sony_laptop_input_index)) {
>  			dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
>  			break;
>  		}
>  		if (sony_laptop_input_index[event] != -1) {
> 
> -
> 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
> 
-- 
mattia
:wq!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [2.6 patch] sony-laptop.c: fix off-by-one
  2008-02-19 23:27 ` Mattia Dongili
@ 2008-02-21  9:58   ` Len Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Len Brown @ 2008-02-21  9:58 UTC (permalink / raw)
  To: Mattia Dongili; +Cc: Adrian Bunk, linux-acpi, linux-kernel

On Tuesday 19 February 2008 18:27, Mattia Dongili wrote:
> Acked-by: Mattia Dongili <malattia@linux.it>

applied.

thanks,
-len

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-21 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 22:59 [2.6 patch] sony-laptop.c: fix off-by-one Adrian Bunk
2008-02-19 23:27 ` Mattia Dongili
2008-02-21  9:58   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox