patch-2.1.16 linux/drivers/char/serial.c

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

diff -u --recursive --new-file v2.1.15/linux/drivers/char/serial.c linux/drivers/char/serial.c
@@ -2365,6 +2365,9 @@
 	if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
 		return;
 
+	if (info->state->type == PORT_UNKNOWN)
+		return;
+
 	orig_jiffies = jiffies;
 	/*
 	 * Set the check interval to be 1/5 of the estimated time to
@@ -2817,9 +2820,6 @@
 	info->port = state->port;
 	info->flags = state->flags;
 
-	if(check_region(info->port,8))
-		return;		/* Area in use */
-
 	save_flags(flags); cli();
 	
 	/*
@@ -3102,6 +3102,12 @@
 	state->irq = req->irq;
 	state->port = req->port;
 	state->flags = req->flags;
+
+	if (check_region(state->port,8)) {
+		restore_flags(flags);
+		printk("register_serial(): I/O region in use\n");
+		return -1;		/* Area in use */
+	}
 	autoconfig(state);
 	if (state->type == PORT_UNKNOWN) {
 		restore_flags(flags);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov