All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core update for 2.6.6-rc1
Date: Thu, 15 Apr 2004 10:41:52 -0700	[thread overview]
Message-ID: <10820509122685@kroah.com> (raw)
In-Reply-To: <10820509122975@kroah.com>

ChangeSet 1.1643.36.10, 2004/03/26 14:24:35-08:00, romain@lievin.net

[PATCH] tipar char driver (divide by zero)

A patch about the tipar.c char driver has been sent on lkml by Sebastien
Bourdeau. It fixes a divide-by-zero error when we try to read/write data
after setting the timeout to 0.


 drivers/char/tipar.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)


diff -Nru a/drivers/char/tipar.c b/drivers/char/tipar.c
--- a/drivers/char/tipar.c	Thu Apr 15 10:20:45 2004
+++ b/drivers/char/tipar.c	Thu Apr 15 10:20:45 2004
@@ -67,7 +67,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "1.17"
+#define DRIVER_VERSION "1.19"
 #define DRIVER_AUTHOR  "Romain Lievin <roms@lpg.ticalc.org>"
 #define DRIVER_DESC    "Device driver for TI/PC parallel link cables"
 #define DRIVER_LICENSE "GPL"
@@ -361,10 +361,13 @@
 
 	switch (cmd) {
 	case IOCTL_TIPAR_DELAY:
-	  delay = (int)arg;    //get_user(delay, &arg);
-	  break;
+		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;
 	  break;
 	default:
 		retval = -ENOTTY;
@@ -399,7 +402,10 @@
 	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 instead.");
 		if (ints[0] > 1) {
 			delay = ints[2];
 		}


  reply	other threads:[~2004-04-15 18:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-15 17:35 [BK PATCH] Driver Core update for 2.6.6-rc1 Greg KH
2004-04-15 17:41 ` [PATCH] " Greg KH
2004-04-15 17:41   ` Greg KH
2004-04-15 17:41     ` Greg KH
2004-04-15 17:41       ` Greg KH
2004-04-15 17:41         ` Greg KH
2004-04-15 17:41           ` Greg KH
2004-04-15 17:41             ` Greg KH
2004-04-15 17:41               ` Greg KH
2004-04-15 17:41                 ` Greg KH
2004-04-15 17:41                   ` Greg KH [this message]
2004-04-15 17:41                     ` Greg KH
2004-04-15 17:41                       ` Greg KH
2004-04-15 17:41                         ` Greg KH
2004-04-15 17:41                           ` Greg KH
2004-04-15 17:41                             ` Greg KH
2004-04-15 17:41                               ` Greg KH
2004-04-15 17:41                                 ` Greg KH
2004-04-15 17:41                                   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10820509122685@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.