This patch take the min platform data array size and keys array size.
authorMichael Trimarchi <michael@panicking.kicks-ass.org>
Tue, 21 Apr 2009 16:23:42 +0000 (11:23 -0500)
committerNelson Castillo <arhuaco@freaks-unidos.net>
Tue, 21 Apr 2009 16:23:42 +0000 (11:23 -0500)
Signed-off-by: Michael Trimarchi <michael@panicking.kicks-ass.org>

drivers/input/keyboard/neo1973kbd.c

index 56d3a68..a95dd58 100644 (file)
@@ -368,8 +368,7 @@ static int neo1973kbd_probe(struct platform_device *pdev)
                goto out_device_create_file;
 
        /* register GPIO IRQs */
-
-       for(n = 0; n < ARRAY_SIZE(keys); n++) {
+       for(n = 0; n < min(pdev->num_resources, ARRAY_SIZE(keys)); n++) {
 
                if (!pdev->resource[0].start)
                        continue;