public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: gus: Fix some error handling paths related to get_bpos() usage
@ 2024-10-03 19:34 Christophe JAILLET
  2024-10-04  7:02 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-10-03 19:34 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Takashi Sakamoto
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, Takashi Iwai,
	linux-sound

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>
---
This patch is speculative. Review with care.
---
 sound/isa/gus/gus_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index bcbcaa924c12..16f9bbb43a54 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -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);
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: gus: Fix some error handling paths related to get_bpos() usage
  2024-10-03 19:34 [PATCH] ALSA: gus: Fix some error handling paths related to get_bpos() usage Christophe JAILLET
@ 2024-10-04  7:02 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-10-04  7:02 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jaroslav Kysela, Takashi Iwai, Takashi Sakamoto, linux-kernel,
	kernel-janitors, Takashi Iwai, linux-sound

On Thu, 03 Oct 2024 21:34:01 +0200,
Christophe JAILLET wrote:
> 
> 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>
> ---
> This patch is speculative. Review with care.

It looks correct.  Applied now.  Thanks!


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-04  7:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03 19:34 [PATCH] ALSA: gus: Fix some error handling paths related to get_bpos() usage Christophe JAILLET
2024-10-04  7:02 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox