Skip to contentSkip to conversation

sony-laptop.c: fix off-by-one

PATCH Applied Adrian Bunk 3 participants 3 messages Feb 19, 2008 – Feb 21, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sony-laptop.c: fix off-by-one

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

---

drivers/misc/sony-laptop.c renamed from drivers/misc/sony-laptop.c.old +1 -1
@@ -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) {
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Adrian Bunk

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

Quoted 20 lines

---

drivers/misc/sony-laptop.c renamed from drivers/misc/sony-laptop.c.old +1 -2
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
mattia
:wq!