Commit 3ed41cd1 authored by Takashi Iwai's avatar Takashi Iwai Committed by Wen Zhiwei
Browse files

ALSA: sh: Fix wrong argument order for copy_from_iter()

stable inclusion
from stable-v6.6.69
commit 0098f6a62ac704a7ca2418872c5c32b14d6fef5f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEPJ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0098f6a62ac704a7ca2418872c5c32b14d6fef5f



--------------------------------

commit 66a0a2b0473c39ae85c44628d14e4366fdc0aa0d upstream.

Fix a brown paper bag bug I introduced at converting to the standard
iter helper; the arguments were wrongly passed and have to be
swapped.

Fixes: 9b5f8ee43e48 ("ALSA: sh: Use standard helper for buffer accesses")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412140019.jat5Dofr-lkp@intel.com/
Link: https://patch.msgid.link/20241220114417.5898-1-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 1c9668ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream,
	/* channel is not used (interleaved data) */
	struct snd_sh_dac *chip = snd_pcm_substream_chip(substream);

	if (copy_from_iter(chip->data_buffer + pos, src, count) != count)
	if (copy_from_iter(chip->data_buffer + pos, count, src) != count)
		return -EFAULT;
	chip->buffer_end = chip->data_buffer + pos + count;