]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: compress: Pay attention if drivers error out retrieving pointers
authorMark Brown <broonie@kernel.org>
Wed, 1 Apr 2026 16:57:35 +0000 (17:57 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 2 Apr 2026 09:10:28 +0000 (11:10 +0200)
Currently we have a return code on the driver pointer operation but the
core ignores that. Let's start paying attention.

Reported-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260401-alsa-unconfigured-tstamp-v1-2-694c2cb5f71d@kernel.org
sound/core/compress_offload.c

index db9f516df8422cb6542bea21d063201f3a069fbb..fd63d219bf86654ca243a516eab9a5843eddb042 100644 (file)
@@ -183,6 +183,8 @@ snd_compr_tstamp32_from_64(struct snd_compr_tstamp *tstamp32,
 static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
                                   struct snd_compr_tstamp64 *tstamp)
 {
+       int ret;
+
        if (!stream->ops->pointer)
                return -ENOTSUPP;
 
@@ -193,7 +195,9 @@ static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
                break;
        }
 
-       stream->ops->pointer(stream, tstamp);
+       ret = stream->ops->pointer(stream, tstamp);
+       if (ret != 0)
+               return ret;
        pr_debug("dsp consumed till %u total %llu bytes\n", tstamp->byte_offset,
                 tstamp->copied_total);
        if (stream->direction == SND_COMPRESS_PLAYBACK)