Skip to contentSkip to conversation

Synclink.c cleanup

PATCH New Eric Sesterhenn 1 participant 1 message Jun 7, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Synclink.c cleanup

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.

drivers/char/synclink.c renamed from drivers/char/synclink.c.orig +2 -2
@@ -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 ||