Skip to contentSkip to conversation

[4223] Prevent use of an uninitialised value in WM8750 and move buffer flush

Qemu-devel Andrzej Zaborowski 1 participant 1 message Apr 20, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 4223

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4223
Author:   balrog
Date:     2008-04-20 03:40:20 +0000 (Sun, 20 Apr 2008)

Log Message:
-----------
Prevent use of an uninitialised value in WM8750 and move buffer flush to a better place (Jan Kiszka).

Modified Paths:
--------------

    trunk/hw/wm8750.c

Modified: trunk/hw/wm8750.c
===================================================================

hw/wm8750.c +2 -1
@@ -76,10 +76,10 @@
 static void wm8750_audio_out_cb(void *opaque, int free_b)
 {
     struct wm8750_s *s = (struct wm8750_s *) opaque;
-    wm8750_out_flush(s);
 
     s->req_out = free_b;
     s->data_req(s->opaque, free_b >> 2, s->req_in >> 2);
+    wm8750_out_flush(s);
 }
 
 struct wm_rate_s {
@@ -213,6 +213,7 @@
 void wm8750_reset(i2c_slave *i2c)
 {
     struct wm8750_s *s = (struct wm8750_s *) i2c;
+    s->rate = &wm_rate_table[0];
     s->enable = 0;
     wm8750_set_format(s);
     s->diff[0] = 0;