From: Adrian Bunk Date: Tue, 19 Feb 2008 22:59:03 +0000 (+0200) Subject: sony-laptop.c: fix off-by-one X-Git-Tag: v2.6.25-rc6~19^2~1^3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d399d130c82a1e1751b7770944f487fbd8b6272a;p=linux-2.6 sony-laptop.c: fix off-by-one This patch fixes an off-by-one spotted by the Coverity checker. Signed-off-by: Adrian Bunk Acked-by: Mattia Dongili Signed-off-by: Len Brown --- diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 899e3f75f2..02ff3d19b1 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c @@ -315,7 +315,7 @@ static void sony_laptop_report_input_event(u8 event) 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; }