]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[PATCH] coverity: tty_ldisc_ref return null check
authorKAMBAROV, ZAUR <kambarov@berkeley.edu>
Thu, 30 Jun 2005 01:12:05 +0000 (18:12 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 15 Jul 2005 21:15:26 +0000 (14:15 -0700)
commit19a51b0ee71ee00497619f441c59b4acd44cf1e5
tree0d1a6263bfb6262e201acaebb1b1cf6e3ede9255
parentaebaaf4060dd0db163694da8e4ab7ba86add57b9
[PATCH] coverity: tty_ldisc_ref return null check

We add a check of the return value of tty_ldisc_ref(), which
is checked 7 out of 8 times, e.g.:

149   ld = tty_ldisc_ref(tty);
150   if (ld != NULL) {
151   if (ld->set_termios)
152   (ld->set_termios)(tty, &old_termios);
153   tty_ldisc_deref(ld);
154   }

This defect was found automatically by Coverity Prevent, a static analysis
tool.

(akpm: presumably `ld' is never NULL.  Oh well)

Signed-off-by: Zaur Kambarov <zkambarov@coverity.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tty_ioctl.c