aboutsummaryrefslogtreecommitdiff
path: root/sound/core/compress_offload.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2013-04-18 11:01:38 +0100
committerTakashi Iwai <tiwai@suse.de>2013-04-21 09:53:00 +0200
commit4daf891cdea2eb63b51cb35a3ac12706f8c50156 (patch)
tree7be791a16c5660f9825d5c428ae1040a22cc7707 /sound/core/compress_offload.c
parent5b1f79f70b0fa0b7ddb28c9ac54c57598fed6347 (diff)
ALSA: compress_core: Deconstify copy callback buffer
The buffer passed to the copy callback should not be const because the copy callback can be used for capture and playback. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/compress_offload.c')
-rw-r--r--sound/core/compress_offload.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 1f69863a83d..52ca4cce146 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -272,10 +272,12 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf,
if (avail > count)
avail = count;
- if (stream->ops->copy)
- retval = stream->ops->copy(stream, buf, avail);
- else
+ if (stream->ops->copy) {
+ char __user* cbuf = (char __user*)buf;
+ retval = stream->ops->copy(stream, cbuf, avail);
+ } else {
retval = snd_compr_write_data(stream, buf, avail);
+ }
if (retval > 0)
stream->runtime->total_bytes_available += retval;