Messages in this thread | | | Date | Fri, 16 Mar 2012 10:43:41 +0100 | From | Jiri Slaby <> | Subject | Re: [PATCH] tty: hold lock across tty buffer finding and buffer filling |
| |
On 03/15/2012 11:14 AM, Du, Alek wrote: > Alan, > > I agree with you for the case of multiple writers to the tty buffer. > > But there is another case that cause kernel hang: driver is writing data to tty, while app shutdown the port or flush through IOCTL. The buf.tail is set to NULL, here is the log: > > > <1>[ 4713.451954] BUG: unable to handle kernel NULL pointer dereference at > 00000004
The trace only suggests that you don't increment tty reference count in irq properly. If you did that, you would not have tty buffer gone by concurrent shutdown.
For the latter case (flush via ioctl), your patch won't help for tty_prepare_string*, as we return pointer to the buffer which is freed by the flush, right?
thanks, -- js suse labs
| |