Skip to contentSkip to conversation

fix some variable initizalization issues

PATCH Applied Stefano Stabellini 2 participants 3 messages Nov 4, 2008 – Nov 12, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix some variable initizalization issues

Hi all,
this patch fixes two variable initialization issues.

---

hw/vga.c +1 -1
index 9540db0..ca8acfe 100644
@@ -2396,7 +2396,7 @@ static void vga_save_dpy_update(DisplayState *s,
 static void vga_save_dpy_resize(DisplayState *s, int w, int h)
 {
     s->linesize = w * 4;
-    s->data = qemu_malloc(h * s->linesize);
+    s->data = qemu_mallocz(h * s->linesize);
     vga_save_w = w;
     vga_save_h = h;
 }
qemu-char.c +1 -0
index ceffbed..be40cee 100644
@@ -935,6 +935,7 @@ static CharDriverState *qemu_chr_open_pty(void)
     }
 
     /* Set raw attributes on the pty. */
+    tcgetattr(slave_fd, &tty);
     cfmakeraw(&tty);
     tcsetattr(slave_fd, TCSAFLUSH, &tty);
     close(slave_fd);
#1 lore raw

I think this patch should be applied, makes valgrind happier :)

Quoted 35 lines · Stefano Stabellini

Hi all,
this patch fixes two variable initialization issues.

---

hw/vga.c +1 -1
index 9540db0..ca8acfe 100644
@@ -2396,7 +2396,7 @@ static void vga_save_dpy_update(DisplayState *s,
 static void vga_save_dpy_resize(DisplayState *s, int w, int h)
 {
     s->linesize = w * 4;
-    s->data = qemu_malloc(h * s->linesize);
+    s->data = qemu_mallocz(h * s->linesize);
     vga_save_w = w;
     vga_save_h = h;
 }
qemu-char.c +1 -0
index ceffbed..be40cee 100644
@@ -935,6 +935,7 @@ static CharDriverState *qemu_chr_open_pty(void)
     }
 
     /* Set raw attributes on the pty. */
+    tcgetattr(slave_fd, &tty);
     cfmakeraw(&tty);
     tcsetattr(slave_fd, TCSAFLUSH, &tty);
     close(slave_fd);
#2 lore raw
Quoted 4 lines · Stefano Stabellini

I think this patch should be applied, makes valgrind happier :)

Stefano Stabellini wrote:

Applied. Thanks.

Regards,

Anthony Liguori