aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2007-12-20 06:23:03 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:34:58 -0500
commite58679805dab3fb75df88141d9d869904a93337f (patch)
treed14ba8ad0f78b026d452b5f05bc6d54aff4deb87 /drivers/usb/serial
parente7b13ec9235b9fded90f826ceeb8c34548631351 (diff)
USB: fix NULL pointer dereference on drivers/usb/serial/whiteheat.c
Am Sonntag, 16. Dezember 2007 05:23:47 schrieb Andrew Morton: > On Sat, 15 Dec 2007 07:08:52 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote: > > > http://bugzilla.kernel.org/show_bug.cgi?id=9573 > > There's a null pointer dereference on drivers/usb/serial/whiteheat.c as > > follows: > > > > (1) line 613: the test "if (port->tty)" implies that null is a legal value > > for "port->tty" at that point > > > > (2) neither firm_open nor firm_purge initialize "port->tty" drivers/usb/serial/usb-serial::serial_open() sets port->tty The check for NULL is bogus. This patch removes the check. Signed-off-by: Oliver Neukum <oneukum@suse.de> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/whiteheat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index ee5dd8b5a713..f5033d482eee 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -610,8 +610,7 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
610 if (retval) 610 if (retval)
611 goto exit; 611 goto exit;
612 612
613 if (port->tty) 613 port->tty->low_latency = 1;
614 port->tty->low_latency = 1;
615 614
616 /* send an open port command */ 615 /* send an open port command */
617 retval = firm_open(port); 616 retval = firm_open(port);