lkml.org 
[lkml]   [2012]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel BUG and freeze on cat /proc/tty/driver/serial
> -       struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
> + struct tty_ldisc *ld = port ? tty_ldisc_ref(port->tty) : NULL;
> struct pps_event_time ts;
>
> if (ld && ld->ops->dcd_change)
> @@ -2465,7 +2465,7 @@ void uart_handle_dcd_change(struct uart_port
> *uport, unsigned int status)
> hardpps();
> #endif
>
> - if (port->flags & ASYNC_CHECK_CD) {
> + if (port && port->flags & ASYNC_CHECK_CD) {
> if (status)
> wake_up_interruptible(&port->open_wait);
> else if (port->tty)

Probably should be using tty krefs for this

tty = tty_port_tty_get( ..) / tty_kref_put

etc, and yes the NULL check is needed. The reference is needed so the tty
can't be freed under you.





\
 
 \ /
  Last update: 2012-05-25 01:41    [W:0.087 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site