Skip to contentSkip to conversation

Remove unneeded null tty check in drivers/usb/serial/io_ti.c

PATCH New Ray Lee 1 participant 1 message Feb 22, 2008

Subsystems (2)
lore
Share & tools
lore

Ray Lee

author
#0 lore raw

PATCH 1/1 Remove unneeded null tty check in drivers/usb/serial/io_ti.c

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.

drivers/usb/serial/io_ti.c +1 -2
Index: linux-2.6/drivers/usb/serial/io_ti.c
===================================================================
@@ -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) {