Messages in this thread Patch in this message | | | Date | Fri, 22 Feb 2008 21:58:52 +0200 | From | Adrian Bunk <> | Subject | [2.6 patch] usb/serial/io_ti.c: remove unneeded NULL check |
| |
On Fri, Feb 22, 2008 at 10:10:16AM +0000, Alan Cox wrote: > > Either the test of port->tty here is unneeded: > > > > if (port->tty) > > port->tty->low_latency = low_latency; > > > > ...or the lack of test of port->tty here is a mistake: > > > > edge_set_termios (port, port->tty->termios); > > Interesting - so coverity doesn't understand the BKL. It's producing the > right answer, for the right reason but the assumption it makes isn't 100% > safe.
Coverity doesn't perform magic. It simply notices that it's once checked and once dereferenced unconditionally.
> The check can go.
Thanks, patch below.
> Alan
cu Adrian
<-- snip -->
There's no reason for checking pdev->bus for being NULL here (and we'd anyway Oops below if it was).
Signed-off-by: Adrian Bunk <bunk@kernel.org>
--- afefd6935c788b3e4071092ebc04c4d356dd7496 diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index cd34059..700683c 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -1944,8 +1944,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp) 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) {
| |