linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A bug (and a fix) in usbserial.c, kernel 2.4.22
@ 2003-10-03 22:27 Andrew Zabolotny
  2003-10-06  7:17 ` James Bourne
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Zabolotny @ 2003-10-03 22:27 UTC (permalink / raw)
  To: linux-kernel

oops, sorry, I was a little wrong. Line 1408 shouldn't be removed but
rather moved before the line that sets port->tty to NULL (e.g. line
559).

--
Greetings,
   Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bug (and a fix) in usbserial.c, kernel 2.4.22
  2003-10-03 22:27 A bug (and a fix) in usbserial.c, kernel 2.4.22 Andrew Zabolotny
@ 2003-10-06  7:17 ` James Bourne
  0 siblings, 0 replies; 4+ messages in thread
From: James Bourne @ 2003-10-06  7:17 UTC (permalink / raw)
  To: Andrew Zabolotny; +Cc: linux-kernel

On Sat, 4 Oct 2003, Andrew Zabolotny wrote:

> oops, sorry, I was a little wrong. Line 1408 shouldn't be removed but
> rather moved before the line that sets port->tty to NULL (e.g. line
> 559).

Don't know if anyone has mentioned this yet.

greg k-h has posted a patch for this some time ago and it can be found at
http://www.hardrock.org/kernel/current-updates/linux-2.4.22-usb-serial.patch


Regards
James Bourne

> --
> Greetings,
>    Andrew

-- 
James Bourne                  | Email:            jbourne@hardrock.org          
Unix Systems Administrator    | WWW:           http://www.hardrock.org
Custom Unix Programming       | Linux:  The choice of a GNU generation
----------------------------------------------------------------------
 "All you need's an occasional kick in the philosophy." Frank Herbert  


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bug (and a fix) in usbserial.c, kernel 2.4.22
  2003-10-03 22:15 Andrew Zabolotny
@ 2003-10-04  0:30 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-10-04  0:30 UTC (permalink / raw)
  To: Andrew Zabolotny; +Cc: linux-kernel

On Sat, Oct 04, 2003 at 02:15:35AM +0400, Andrew Zabolotny wrote:
> The __serial_close function is setting port->tty to NULL, so the
> solution is to remove either the line 559:
> 
> ...
> port->open_count = 0;
> port->tty = NULL;
> ...
> 
> or line 1408 (which seems a better solution to me).

Or see the patch that is already in the 2.4.23-pre kernel tree :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* A bug (and a fix) in usbserial.c, kernel 2.4.22
@ 2003-10-03 22:15 Andrew Zabolotny
  2003-10-04  0:30 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Zabolotny @ 2003-10-03 22:15 UTC (permalink / raw)
  To: linux-kernel

Hello!

I was using the usbserial driver to connect to my PDA and was quite
surprised when I have seen kernel oops messages in /var/log/messages
after I disconnect my PDA.

A examination of /proc/kcore shown that the bug happens in line 1408 of
usbserial.c, here is a extract:

if (port->tty != NULL) {
  while (port->open_count > 0) {
    __serial_close(port, NULL);
  }
  port->tty->driver_data = NULL;
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the line that oopses.
}

The __serial_close function is setting port->tty to NULL, so the
solution is to remove either the line 559:

...
port->open_count = 0;
port->tty = NULL;
...

or line 1408 (which seems a better solution to me).

--
Greetings,
   Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-06  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-03 22:27 A bug (and a fix) in usbserial.c, kernel 2.4.22 Andrew Zabolotny
2003-10-06  7:17 ` James Bourne
  -- strict thread matches above, loose matches on Subject: below --
2003-10-03 22:15 Andrew Zabolotny
2003-10-04  0:30 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).