[PATCH] char/synclink_gt: fix uninitialized return value in put_char()

From: Chris Peterson
Date: Sat May 10 2008 - 15:13:34 EST



put_char() can return an uninitialized value of 'ret' in one code path.

Signed-off-by: Chris Peterson <cpeterso@xxxxxxxxxxxx>
---
--- linux-2.6.25-rc1-git7-before/drivers/char/synclink_gt.c 2008-05-10 11:43:19.000000000 -0700
+++ linux-2.6.25-rc1-git7-after/drivers/char/synclink_gt.c 2008-05-10 11:51:22.000000000 -0700
@@ -927,6 +927,8 @@ static int put_char(struct tty_struct *t
if (!info->tx_active && (info->tx_count < info->max_frame_size)) {
info->tx_buf[info->tx_count++] = ch;
ret = 1;
+ } else {
+ ret = 0;
}
spin_unlock_irqrestore(&info->lock,flags);
return ret;
--
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/