mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Cc: Chuck Ebbert <cebbert@redhat.com>,
	"Mario 'BitKoenig' Holbe" <Mario.Holbe@tu-ilmenau.de>,
	linux-kernel@vger.kernel.org
Subject: Re: kernel BUG and freeze on cat /proc/tty/driver/serial
Date: Fri, 25 May 2012 00:09:34 +0100	[thread overview]
Message-ID: <20120525000934.78136313@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <CAJJYPdnTMZiTi6OT2cqk_h_e8+m8iGZqVK_zazLM39eFWLf5xw@mail.gmail.com>

> -       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.




  reply	other threads:[~2012-05-24 23:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 16:17 Mario 'BitKoenig' Holbe
2011-03-08 16:10 ` Mario 'BitKoenig' Holbe
2011-03-10  6:49 ` Chuck Ebbert
2011-09-02 18:23   ` Zdenek Kabelac
2012-05-24 21:09     ` Zdenek Kabelac
2012-05-24 23:09       ` Alan Cox [this message]
2012-05-25  8:23         ` Zdenek Kabelac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120525000934.78136313@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=Mario.Holbe@tu-ilmenau.de \
    --cc=cebbert@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zdenek.kabelac@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome