summaryrefslogtreecommitdiff
path: root/hw/s390x/sclpconsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/s390x/sclpconsole.c')
-rw-r--r--hw/s390x/sclpconsole.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/s390x/sclpconsole.c b/hw/s390x/sclpconsole.c
index adc0ee83f4..effe51110f 100644
--- a/hw/s390x/sclpconsole.c
+++ b/hw/s390x/sclpconsole.c
@@ -44,12 +44,9 @@ typedef struct SCLPConsole {
/* Return number of bytes that fit into iov buffer */
static int chr_can_read(void *opaque)
{
- int can_read;
SCLPConsole *scon = opaque;
- can_read = SIZE_BUFFER_VT220 - scon->iov_data_len;
-
- return can_read;
+ return scon->iov ? SIZE_BUFFER_VT220 - scon->iov_data_len : 0;
}
/* Receive n bytes from character layer, save in iov buffer,