Re: [PATCH] missing NULL check in drivers/char/n_tty.c

From: Dan Aloni
Date: Mon Jun 21 2004 - 17:48:53 EST


On Mon, Jun 21, 2004 at 11:46:05AM -0700, Andrew Morton wrote:
> Paul Fulghum <paulkf@xxxxxxxxxxxxx> wrote:
> >
> > 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
>
> Option 1 is quite valid. There are no bugs here, yes?
>
> If someone for some reason wants to clean all this up, the best way would
> be to require that ->chars_in_buffer always be valid, hence remove all
> those checks.

Apropos cleanups in the tty subsystem, what is the purpose of all
the *_paranoia_check() calls that almost every driver duplicates for
itself? Perhaps this can be removed.

--
Dan Aloni
da-x@xxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/