Re: 2.0.33 bad magic number for tty struct in release_dev?

Theodore Y. Ts'o (
Mon, 25 May 1998 00:16:01 -0400

Date: Sat, 23 May 1998 12:41:08 -0400 (EDT)
From: Tom Oehser <>

After hours or days OK I get these messages and bad things happen:

Warning: bad magic number for tty struct (04:42) in release_dev

rs_close: bad serial port count; tty->count is 1, info->count is 2

I searched around the web and usenet and found no useful answers. Let me
know any info I can provide that might help, I'm running 2.0.33, pppd
2.2.0g, diald 0.16, setserial 2.13, and the device is a MultiTech
MT5634ZPX internal modem jumpered to ioport 3e8 irq 5 with current
firmware applied.

It works for sometimes days at a time, btw; but when these things happen I
seem to have to reboot to get at it again. It seems like it must be a bug
in the serial or tty drivers or pppd?

Try the following patch. It should fix your problems. (Please let me
known if it does, so I get confirmation; thanks!)

- Ted

Patch generated: on Sat May 16 00:03:34 EDT 1998 by
against Linux version 2.0.33

RCS file: drivers/char/RCS/tty_io.c,v
retrieving revision 1.1
diff -u -r1.1 drivers/char/tty_io.c
--- drivers/char/tty_io.c 1998/05/16 03:54:33 1.1
+++ drivers/char/tty_io.c 1998/05/16 03:55:18
@@ -1163,6 +1163,10 @@
+ if (tty->driver.close)
+ tty->driver.close(tty, filp);
* Sanity check: if tty->count is going to zero, there shouldn't be
* any waiters on tty->read_wait or tty->write_wait. We test the
@@ -1219,9 +1223,6 @@
* both sides, and we've completed the last operation that could
* block, so it's safe to proceed with closing.
- if (tty->driver.close)
- tty->driver.close(tty, filp);

if (pty_master) {
if (--o_tty->count < 0) {

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to