Skip to contentSkip to conversation

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

PATCH In review Igor Mammedov 4 participants 5 messages Jun 25, 2014 – Jun 26, 2014

lore
Share & tools
lore
#0 lore raw

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

---
 qemu-char.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-char.c +1 -1
index 2e50a10..f6bdf2f 100644
@@ -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) {
Signature · 1 line
1.7.1
Reviewed-by
#3 lore raw

Am 25.06.2014 13:51, schrieb Igor Mammedov:

Quoted 7 lines
Quoted 4 lines · On Wed, 25 Jun 2014 11:08:29 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 1 line · Igor Mammedov
Quoted 8 lines
Quoted 5 lines

Broken in commit 9005b2a (author cc'ed). Bites only when passed zero len, which seems unlikely.

main motivation for the patch was to allow -Werror=all build pass.

As I sent an identical patch some minutes ago, I can add

#4 lore raw
Quoted 14 lines · Stefan Weil

Am 25.06.2014 13:51, schrieb Igor Mammedov:

Quoted 13 lines
Quoted 9 lines · On Wed, 25 Jun 2014 11:08:29 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 1 line · Igor Mammedov

Broken in commit 9005b2a (author cc'ed). Bites only when passed zero len, which seems unlikely.

Quoted 6 lines
Quoted 2 lines

main motivation for the patch was to allow -Werror=all build pass.

As I sent an identical patch some minutes ago, I can add

Applied to master as a buildfix; thanks.

-- PMM