[PATCH] drivers/char/tipar.c: off by one array access

From: Luc Van Oostenryck
Date: Sun Jun 19 2005 - 10:13:30 EST

In the setupt function, the delay variable is initialized with ints[2],
but ints is declared as:
int ints[2];

Since the module parameter should correspond to:

I suppose that the following patch fix the problem.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxxx>

diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -407,7 +407,7 @@ tipar_setup(char *str)
printk(KERN_WARNING "tipar: bad timeout value (0), "
"using default value instead");
if (ints[0] > 1) {
- delay = ints[2];
+ delay = ints[1];

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/