Re: [PATCH] missing NULL check in drivers/char/n_tty.c
From: Paul Fulghum (paulkf_at_microgate.com)
Date: 06/21/04
- Previous message: Martin Knoblauch: "Problems with 2.6.7-mm1 on HP Omnibook 6100"
- In reply to: Dan Aloni: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Next in thread: Andrew Morton: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Reply: Andrew Morton: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 21 Jun 2004 10:06:46 -0500 To: Dan Aloni <da-x@colinux.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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Martin Knoblauch: "Problems with 2.6.7-mm1 on HP Omnibook 6100"
- In reply to: Dan Aloni: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Next in thread: Andrew Morton: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Reply: Andrew Morton: "Re: [PATCH] missing NULL check in drivers/char/n_tty.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|