diff --git a/qemu-char.c b/qemu-char.c index 74c60e11a0..a9fc50481a 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -160,7 +160,9 @@ int qemu_chr_be_can_write(CharDriverState *s) void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len) { - s->chr_read(s->handler_opaque, buf, len); + if (s->chr_read) { + s->chr_read(s->handler_opaque, buf, len); + } } int qemu_chr_fe_get_msgfd(CharDriverState *s)