qemu-char: fix warning 'res' may be used uninitialized

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 1403683241-20678-1-git-send-email-imammedo@redhat.com
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Igor Mammedov 2014-06-25 10:00:41 +02:00 committed by Peter Maydell
parent 2b5b7ae917
commit 0931304788

View file

@ -132,7 +132,7 @@ int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)
int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)
{
int offset = 0;
int res;
int res = 0;
qemu_mutex_lock(&s->chr_write_lock);
while (offset < len) {