Commit 9df39a87 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Takashi Iwai
Browse files

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: a6970bb1 ("ALSA: gus: Convert to the new PCM ops")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/d9ca841edad697154afa97c73a5d7a14919330d9.1727984008.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3e880027
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -364,7 +364,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);
@@ -381,7 +381,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);