[PATCH] Trivial bugfix in tipar
From: Sebastien B
Date: Sat Mar 20 2004 - 08:39:14 EST
Hi !
This small patch for drivers/char/tipar.c fixes a divide-by-zero error when
you try to read/write data after setting the timeout to 0.
Please apply,
Seb
--- tipar.c Sat Mar 20 13:48:55 2004
+++ /usr/src/linux/drivers/char/tipar.c Sat Mar 20 14:06:53 2004
@@ -364,7 +364,7 @@
delay = (int)arg; //get_user(delay, &arg);
break;
case IOCTL_TIPAR_TIMEOUT:
- timeout = (int)arg; //get_user(timeout, &arg);
+ if (arg != 0) timeout = (int)arg; else retval = -EINVAL; //
get_user(timeout, &arg);
break;
default:
retval = -ENOTTY;
@@ -399,7 +399,7 @@
str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0) {
- timeout = ints[1];
+ if (ints[1] != 0) timeout = ints[1]; else printk("tipar: wrong
timeout value (0), using default value");
if (ints[0] > 1) {
delay = ints[2];
}
-
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/