Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: Don't allow pointer operations on unconfigured streams

When reporting the pointer for a compressed stream we report the current
I/O frame position by dividing the position by the number of channels
multiplied by the number of container bytes. These values default to 0 and
are only configured as part of setting the stream parameters so this allows
a divide by zero to be configured. Validate that they are non zero,
returning an error if not

Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260326-asoc-compress-tstamp-params-v1-1-3dc735b3d599@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

+3
+3
sound/soc/sof/compress.c
··· 381 381 if (!spcm) 382 382 return -EINVAL; 383 383 384 + if (!sstream->channels || !sstream->sample_container_bytes) 385 + return -EBUSY; 386 + 384 387 tstamp->sampling_rate = sstream->sampling_rate; 385 388 tstamp->copied_total = sstream->copied_total; 386 389 tstamp->pcm_io_frames = div_u64(spcm->stream[cstream->direction].posn.dai_posn,