aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-20 03:40:20 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-20 03:40:20 +0000
commiteb69b50ad9806c4a3b5900392a5acc9837cffd18 (patch)
tree39a8cc38f003749d060f65b7658fb97844fb5b0a /hw
parent601d70b9e5dea95a3854ba801672786f40230b75 (diff)
Prevent use of an uninitialised value in WM8750 and move buffer flush
to a better place (Jan Kiszka). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4223 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/wm8750.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/wm8750.c b/hw/wm8750.c
index 8243ca54b6..7d7f08ba16 100644
--- a/hw/wm8750.c
+++ b/hw/wm8750.c
@@ -76,10 +76,10 @@ static void wm8750_audio_in_cb(void *opaque, int avail_b)
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 @@ static void inline wm8750_mask_update(struct wm8750_s *s)
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;