Skip to content

Commit 6018f2f

Browse files
arndbtiwai
authored andcommitted
ALSA: compress_offload: avoid 64-bit get_user()
On some architectures, get_user() cannot read a 64-bit user variable: arm-linux-gnueabi-ld: sound/core/compress_offload.o: in function `snd_compr_ioctl': compress_offload.c:(.text.snd_compr_ioctl+0x538): undefined reference to `__get_user_bad' Use an equivalent copy_from_user() instead. Fixes: 0417715 ("ALSA: compress_offload: introduce accel operation mode") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Shengjiu Wang <[email protected]> Acked-by: Vinod Koul <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 1ae40d5 commit 6018f2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/core/compress_offload.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,9 +1180,9 @@ static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg
11801180

11811181
if (stream->runtime->state != SNDRV_PCM_STATE_SETUP)
11821182
return -EPERM;
1183-
retval = get_user(seqno, (__u64 __user *)arg);
1184-
if (retval < 0)
1185-
return retval;
1183+
retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno));
1184+
if (retval)
1185+
return -EFAULT;
11861186
retval = 0;
11871187
if (seqno == 0) {
11881188
list_for_each_entry_reverse(task, &stream->runtime->tasks, list)

0 commit comments

Comments
 (0)