Skip to contentSkip to conversation

tty: Fix hvc return

PATCH New Alan Cox 1 participant 1 message Sep 17, 2012

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 tty: Fix hvc return

From: Alan Cox <[email protected]>

HVC returns a size of -1 bytes for the write room in some cases. This is bogus and not handled by the tty layer at all.

---

 drivers/tty/hvc/hvc_console.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/hvc/hvc_console.c +1 -1
index b57dcbd..a5dec1c 100644
@@ -568,7 +568,7 @@ static int hvc_write_room(struct tty_struct *tty)
 	struct hvc_struct *hp = tty->driver_data;
 
 	if (!hp)
-		return -1;
+		return 0;
 
 	return hp->outbuf_size - hp->n_outbuf;
 }