diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-06 23:35:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:31 -0500 |
commit | e45f4676108d19ae93918f06cb6731c86108341a (patch) | |
tree | 66811c091d94f77697835e53d6d9b052af143982 /sound/oss/emu10k1/audio.c | |
parent | 91046a8a693823d434f0aa70419c48ebeb8e1b11 (diff) |
[PATCH] sound/oss/emu10k1: handle userspace copy errors
Propagate copy_to/from_user() errors back through callers.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/emu10k1/audio.c')
-rw-r--r-- | sound/oss/emu10k1/audio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c index 86dd23974e0..49f902f35c2 100644 --- a/sound/oss/emu10k1/audio.c +++ b/sound/oss/emu10k1/audio.c | |||
@@ -111,9 +111,15 @@ static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t | |||
111 | 111 | ||
112 | if ((bytestocopy >= wiinst->buffer.fragment_size) | 112 | if ((bytestocopy >= wiinst->buffer.fragment_size) |
113 | || (bytestocopy >= count)) { | 113 | || (bytestocopy >= count)) { |
114 | int rc; | ||
115 | |||
114 | bytestocopy = min_t(u32, bytestocopy, count); | 116 | bytestocopy = min_t(u32, bytestocopy, count); |
115 | 117 | ||
116 | emu10k1_wavein_xferdata(wiinst, (u8 __user *)buffer, &bytestocopy); | 118 | rc = emu10k1_wavein_xferdata(wiinst, |
119 | (u8 __user *)buffer, | ||
120 | &bytestocopy); | ||
121 | if (rc) | ||
122 | return rc; | ||
117 | 123 | ||
118 | count -= bytestocopy; | 124 | count -= bytestocopy; |
119 | buffer += bytestocopy; | 125 | buffer += bytestocopy; |