public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] Remove unneeded null tty check in drivers/usb/serial/io_ti.c
@ 2008-02-22 16:12 Ray Lee
  0 siblings, 0 replies; only message in thread
From: Ray Lee @ 2008-02-22 16:12 UTC (permalink / raw)
  To: LKML; +Cc: Alan Cox, Adrian Bunk, linux-usb, Greg KH

The Coverity checker (and Adrian Bunk) spotted an inconsistent
NULL check of port->tty (it's blindly dereferenced later without
the check).

Alan Cox confirmed the check can go.

Signed-off-by: Ray Lee <ray-lk@madrabbit.org>

cc: linux-usb@vger.kernel.org
cc: Greg KH <gregkh@suse.de>
cc: Adrian Bunk <bunk@kernel.org>
cc: linux-kernel@vger.kernel.org
cc: Alan Cox <alan@lxorguk.ukuu.org.uk>

Index: linux-2.6/drivers/usb/serial/io_ti.c
===================================================================
--- linux-2.6.orig/drivers/usb/serial/io_ti.c	2008-02-22 07:26:47.000000000 -0800
+++ linux-2.6/drivers/usb/serial/io_ti.c	2008-02-22 07:28:12.000000000 -0800
@@ -1944,8 +1944,7 @@ static int edge_open (struct usb_serial_
  	if (edge_port == NULL)
  		return -ENODEV;

-	if (port->tty)
-		port->tty->low_latency = low_latency;
+	port->tty->low_latency = low_latency;

  	port_number = port->number - port->serial->minor;
  	switch (port_number) {

-- 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-22 16:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 16:12 [patch] Remove unneeded null tty check in drivers/usb/serial/io_ti.c Ray Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox