[PATCH] serial.c MOD_DEC_USE_COUNT missing on rs_init

From: Arnaldo Carvalho de Melo (acme@gnu.org)
Date: Sun Jul 02 2000 - 14:01:18 EST


Hi,

    Ted, please take a look at this patch that includes missing
MOD_DEC_USE_COUNT at some places.

- Arnaldo

--- linux-2.4.0-test3-pre2./drivers/char/serial.c Sun Jul 2 15:44:56 2000
+++ linux-2.4.0-test3-pre2.acme/drivers/char/serial.c Sun Jul 2 15:50:07 2000
@@ -45,6 +45,9 @@
  *
  * 5/00: Support for the RSA-DV II/S card added.
  * Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+ *
+ * 7/00: fix some returns on failure not using MOD_DEC_USE_COUNT.
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  *
  * This module exports the following rs232 io functions:
  *
@@ -3105,8 +3108,10 @@
         }
         tty->driver_data = info;
         info->tty = tty;
- if (serial_paranoia_check(info, tty->device, "rs_open"))
+ if (serial_paranoia_check(info, tty->device, "rs_open")) {
+ MOD_DEC_USE_COUNT;
                 return -ENODEV;
+ }
 
 #ifdef SERIAL_DEBUG_OPEN
         printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line,
@@ -3119,6 +3124,7 @@
         if (!tmp_buf) {
                 page = get_zeroed_page(GFP_KERNEL);
                 if (!page) {
+ MOD_DEC_USE_COUNT;
                         return -ENOMEM;
                 }
                 if (tmp_buf)
@@ -3134,6 +3140,7 @@
             (info->flags & ASYNC_CLOSING)) {
                 if (info->flags & ASYNC_CLOSING)
                         interruptible_sleep_on(&info->close_wait);
+ MOD_DEC_USE_COUNT;
 #ifdef SERIAL_DO_RESTART
                 return ((info->flags & ASYNC_HUP_NOTIFY) ?
                         -EAGAIN : -ERESTARTSYS);
@@ -3147,6 +3154,7 @@
          */
         retval = startup(info);
         if (retval) {
+ MOD_DEC_USE_COUNT;
                 return retval;
         }
 
@@ -3156,6 +3164,7 @@
                 printk("rs_open returning after block_til_ready with %d\n",
                        retval);
 #endif
+ MOD_DEC_USE_COUNT;
                 return retval;
         }
 

                        - Arnaldo

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



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:12 EST