patch-2.4.0-test12 linux/drivers/char/isicom.c

Next file: linux/drivers/char/istallion.c
Previous file: linux/drivers/char/esp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/drivers/char/isicom.c linux/drivers/char/isicom.c
@@ -582,9 +582,11 @@
 #endif							
 							port->status &= ~ISI_DCD;
 							if (!((port->flags & ASYNC_CALLOUT_ACTIVE) &&
-								(port->flags & ASYNC_CALLOUT_NOHUP)))
-								queue_task(&port->hangup_tq,
-									&tq_scheduler);
+								(port->flags & ASYNC_CALLOUT_NOHUP))) {
+								MOD_INC_USE_COUNT;
+								if (schedule_task(&port->hangup_tq) == 0)
+									MOD_DEC_USE_COUNT;
+							}
 						}
 					}
 					else {
@@ -1630,10 +1632,9 @@
 	struct tty_struct * tty;
 	
 	tty = port->tty;
-	if (!tty)
-		return;
-		
-	tty_hangup(tty);	
+	if (tty)
+		tty_hangup(tty);	/* FIXME: module removal race here - AKPM */
+	MOD_DEC_USE_COUNT;
 }
 
 static void isicom_hangup(struct tty_struct * tty)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)