From: Paul Fulghum <paulkf@microgate.com>
To: Dan Aloni <da-x@colinux.org>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] missing NULL check in drivers/char/n_tty.c
Date: Mon, 21 Jun 2004 10:06:46 -0500 [thread overview]
Message-ID: <40D6F986.3010904@microgate.com> (raw)
In-Reply-To: <20040621082430.GA11566@callisto.yi.org>
Dan Aloni wrote:
> Andrew Morton wrote:
> I did a quick grep and it appears that all drivers have set ->chars_in_buffer().
>
> I suspect there are no drivers which fail to set chars_in_buffer.
> Otherwise normal_poll() would have been oopsing in 2.4, 2.5 and 2.6?
An addition should be made to include/linux/tty_driver.h
to document the chars_in_buffer member of struct tty_driver
and struct tty_operations as a required function.
Currently, the documentation section of this header
does not mention chars_in_buffer.
Related issue:
In looking at this, I noticed struct tty_ldisc
(include/linux/tty_ldisc.h) defines and documents
an optional (optional == NULL) member chars_in_buffer.
N_TTY (drivers/char/n_tty.c) is the only line discipline
that implements this member.
drivers/char/pty.c is the only driver that
uses ldisc.chars_in_buffer, and it checks for
ldisc.chars_in_buffer == NULL before calling.
13 other drivers call ldisc.chars_in_buffer without checking
for ldisc.chars_in_buffer == NULL, but only inside conditional
compilation for debug output. The value is not used, only logged.
These conditional debug items look like cut and paste from
one serial driver to another, and I doubt
they have been recently used (or used at all).
Which would be better?
1. Ignore this
2. Fix conditional debug output to check
for ldisc.chars_in_buffer==NULL
3. Remove conditional debug output
--
Paul Fulghum
paulkf@microgate.com
next prev parent reply other threads:[~2004-06-21 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-21 6:38 [PATCH] missing NULL check in drivers/char/n_tty.c Dan Aloni
2004-06-21 6:58 ` Andrew Morton
2004-06-21 7:36 ` Dan Aloni
2004-06-21 7:39 ` Andrew Morton
2004-06-21 8:24 ` Dan Aloni
2004-06-21 15:06 ` Paul Fulghum [this message]
2004-06-21 18:46 ` Andrew Morton
2004-06-21 19:52 ` Paul Fulghum
2004-06-21 22:48 ` Dan Aloni
2004-06-21 23:56 ` Paul Fulghum
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=40D6F986.3010904@microgate.com \
--to=paulkf@microgate.com \
--cc=akpm@osdl.org \
--cc=da-x@colinux.org \
--cc=linux-kernel@vger.kernel.org \
/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