diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2004-05-10 19:50:39 -0400 |
---|---|---|
committer | David S. Miller <davem@nuts.davemloft.net> | 2004-05-10 19:50:39 -0400 |
commit | 168616367afb06b1398b9ef971fb80175ea4c683 (patch) | |
tree | 028ee1d493bdd92f97cc2097df26394ebae5de4c /sound | |
parent | e026d85d9b6093cb79689d4410e7f2b36851a97d (diff) | |
download | history-168616367afb06b1398b9ef971fb80175ea4c683.tar.gz |
[sound/oss i810] fix race
This patch fixes the value of swptr in case of an underrun/overrun.
Overruns/underruns probably won't occur at all when the driver is
fixed properly, but this doesn't hurt.
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/i810_audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index bc492c17389424..33a0c331731d3f 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c @@ -1456,8 +1456,8 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t * } continue; } - swptr = dmabuf->swptr; cnt = i810_get_available_read_data(state); + swptr = dmabuf->swptr; // this is to make the copy_to_user simpler below if(cnt > (dmabuf->dmasize - swptr)) cnt = dmabuf->dmasize - swptr; @@ -1600,8 +1600,8 @@ static ssize_t i810_write(struct file *file, const char *buffer, size_t count, l continue; } - swptr = dmabuf->swptr; cnt = i810_get_free_write_space(state); + swptr = dmabuf->swptr; /* Bound the maximum size to how much we can copy to the * dma buffer before we hit the end. If we have more to * copy then it will get done in a second pass of this |