summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-10-03 21:34:01 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-10 11:57:20 +0200
commitb0f3c6a2d0bdc3cb7cbfddb8ce5603b17f359f02 (patch)
tree68eeb6209c5d4b76d482e92868dc4d64a70f80a5 /sound
parent2c3c1f87cf7e151c327e38123c1a20eb9447247e (diff)
downloadlinux-b0f3c6a2d0bdc3cb7cbfddb8ce5603b17f359f02.tar.gz
linux-b0f3c6a2d0bdc3cb7cbfddb8ce5603b17f359f02.tar.bz2
linux-b0f3c6a2d0bdc3cb7cbfddb8ce5603b17f359f02.zip
ALSA: gus: Fix some error handling paths related to get_bpos() usage
[ Upstream commit 9df39a872c462ea07a3767ebd0093c42b2ff78a2 ] If get_bpos() fails, it is likely that the corresponding error code should be returned. Fixes: a6970bb1dd99 ("ALSA: gus: Convert to the new PCM ops") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/d9ca841edad697154afa97c73a5d7a14919330d9.1727984008.git.christophe.jaillet@wanadoo.fr Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/isa/gus/gus_pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 850544725da7..d55c3dc229c0 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -378,7 +378,7 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream,
bpos = get_bpos(pcmp, voice, pos, len);
if (bpos < 0)
- return pos;
+ return bpos;
if (copy_from_iter(runtime->dma_area + bpos, len, src) != len)
return -EFAULT;
return playback_copy_ack(substream, bpos, len);
@@ -395,7 +395,7 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream,
bpos = get_bpos(pcmp, voice, pos, len);
if (bpos < 0)
- return pos;
+ return bpos;
snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos,
bytes_to_samples(runtime, count));
return playback_copy_ack(substream, bpos, len);