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

From: Andrew Morton
Date: Mon Jun 21 2004 - 13:48:03 EST


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.

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