* [PATCH] ALSA: compress: Set metadata_set only after successful callback
@ 2026-11-13 9:11 Sreeraj S Kurup
2026-11-13 9:25 ` [PATCH v2] " Sreeraj S Kurup
0 siblings, 1 reply; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-11-13 9:11 UTC (permalink / raw)
To: tiwai, perex; +Cc: linux-kernel, linux-sound, Sreeraj S Kurup
Set the metadata_set flag only when the driver's set_metadata()
callback completes successfully.
Previously, the flag was set even when the callback returned an
error. This incorrectly indicated that metadata had been applied
successfully, potentially causing later operations to skip metadata
setup.
Update the flag only when the callback returns zero so that its
state accurately reflects successful metadata submission.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/core/compress_offload.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 5e5e0f78f26d..9b53282e0192 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -796,8 +796,8 @@ snd_compr_set_metadata(struct snd_compr_stream *stream, unsigned long arg)
return -EFAULT;
retval = stream->ops->set_metadata(stream, &metadata);
- stream->metadata_set = true;
-
+ if (!retval)
+ stream->metadata_set = true;
return retval;
}
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2] ALSA: compress: Set metadata_set only after successful callback
2026-11-13 9:11 [PATCH] ALSA: compress: Set metadata_set only after successful callback Sreeraj S Kurup
@ 2026-11-13 9:25 ` Sreeraj S Kurup
0 siblings, 0 replies; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-11-13 9:25 UTC (permalink / raw)
To: sreekuttan2156239; +Cc: linux-kernel, linux-sound, perex, tiwai
Set the metadata_set flag only when the driver's set_metadata()
callback completes successfully.
Previously, the flag was set even when the callback returned an
error. This incorrectly indicated that metadata had been applied
successfully, potentially causing later operations to skip metadata
setup.
Update the flag only when the callback returns zero so that its
state accurately reflects successful metadata submission.
Fixes: 9727b490e543 ("ALSA: compress: add support for gapless playback")
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
v2:
- Add Fixes trailer.
sound/core/compress_offload.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 5e5e0f78f26d..9b53282e0192 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -796,8 +796,8 @@ snd_compr_set_metadata(struct snd_compr_stream *stream, unsigned long arg)
return -EFAULT;
retval = stream->ops->set_metadata(stream, &metadata);
- stream->metadata_set = true;
-
+ if (!retval)
+ stream->metadata_set = true;
return retval;
}
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-13 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 9:11 [PATCH] ALSA: compress: Set metadata_set only after successful callback Sreeraj S Kurup
2026-11-13 9:25 ` [PATCH v2] " Sreeraj S Kurup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®