[PATCH] Synclink.c cleanup

From: Eric Sesterhenn
Date: Wed Jun 07 2006 - 18:10:11 EST


hi,

coverity was lead to two false bug reports ( #782, #783 )
where the driver checked if tty was valid, when it should
always be. All cases which I found call these functions
by tty->driver->mgsl_write(...) so tty has to be valid.
This patch removes those two checks.

Signed-off-by: Eric Sesterhenn <snakebyte@xxxxxx>

--- linux-2.6.17-rc5/drivers/char/synclink.c.orig 2006-06-08 00:06:04.000000000 +0200
+++ linux-2.6.17-rc5/drivers/char/synclink.c 2006-06-08 00:06:56.000000000 +0200
@@ -2049,7 +2049,7 @@ static void mgsl_put_char(struct tty_str
if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
return;

- if (!tty || !info->xmit_buf)
+ if (!info->xmit_buf)
return;

spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -2139,7 +2139,7 @@ static int mgsl_write(struct tty_struct
if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
goto cleanup;

- if (!tty || !info->xmit_buf)
+ if (!info->xmit_buf)
goto cleanup;

if ( info->params.mode == MGSL_MODE_HDLC ||


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/