Skip to content

Commit 9df39a8

Browse files
tititiou36tiwai
authored andcommitted
ALSA: gus: Fix some error handling paths related to get_bpos() usage
If get_bpos() fails, it is likely that the corresponding error code should be returned. Fixes: a6970bb ("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>
1 parent 3e88002 commit 9df39a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/isa/gus/gus_pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream,
364364

365365
bpos = get_bpos(pcmp, voice, pos, len);
366366
if (bpos < 0)
367-
return pos;
367+
return bpos;
368368
if (copy_from_iter(runtime->dma_area + bpos, len, src) != len)
369369
return -EFAULT;
370370
return playback_copy_ack(substream, bpos, len);
@@ -381,7 +381,7 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream,
381381

382382
bpos = get_bpos(pcmp, voice, pos, len);
383383
if (bpos < 0)
384-
return pos;
384+
return bpos;
385385
snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos,
386386
bytes_to_samples(runtime, count));
387387
return playback_copy_ack(substream, bpos, len);

0 commit comments

Comments
 (0)