Skip to contentSkip to conversation

ASoC: rt766: fix uninitialized stream_config->type

PATCH In review [email protected] 2 participants 3 messages Sep 4

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/6 ASoC: rt766: fix uninitialized stream_config->type

From: Shuming Fan <[email protected]>

The stream_config variable was not initialized before being passed to sdw_stream_add_slave().
This may cause unexpected behavior when configuring the SoundWire stream.

---
 sound/soc/codecs/rt766-sdca.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/codecs/rt766-sdca.c +1 -4
index 64d763b96a06..5a1c1e10e6d7 100644
@@ -936,9 +936,8 @@ static int rt766_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_component *component = dai->component;
 	struct rt766_sdca_priv *rt766 = snd_soc_component_get_drvdata(component);
-	struct sdw_stream_config stream_config;
+	struct sdw_stream_config stream_config = {0};
 	struct sdw_port_config port_config;
-	enum sdw_data_direction direction;
 	struct sdw_stream_runtime *sdw_stream;
 	unsigned int sampling_rate;
 	int retval, port;
@@ -957,7 +956,6 @@ static int rt766_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
 
 	/* SoundWire specific configuration */
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		direction = SDW_DATA_DIR_RX;
 		if (dai->id == RT766_AIF1)
 			port = 3;
 		else if (dai->id == RT766_AIF2)
@@ -965,7 +963,6 @@ static int rt766_sdca_pcm_hw_params(struct snd_pcm_substream *substream,
 		else
 			return -EINVAL;
 	} else {
-		direction = SDW_DATA_DIR_TX;
 		if (dai->id == RT766_AIF1)
 			port = 12;
 		else if (dai->id == RT766_AIF3)
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 5 lines · On Fri, Sep 04, 2026 at 03:57:37PM +0800, [email protected] wrote:

From: Shuming Fan <[email protected]>

The stream_config variable was not initialized before being passed to sdw_stream_add_slave().
This may cause unexpected behavior when configuring the SoundWire stream.

Not related to this patch specifically but I notice that whenever you send a patch series you send a bunch of individual messages which don't end up threaded with each other, this causes issues for tooling so it'd be good if you could get threading working.

You might want to look at b4 to send the patches, especially it's web submission endpoint which avoids having to configure mail:

https://b4.docs.kernel.org/en/latest/contributor/overview.html

this will thread things in the expected manner.

maintainer
#2 lore raw
In reply to [email protected]
Quoted 1 line · On Fri, 04 Sep 2026 15:57:37 +0800, [email protected] wrote:

ASoC: rt766: fix uninitialized stream_config->type

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3

Thanks!

[1/6] ASoC: rt766: fix uninitialized stream_config->type

      https://git.kernel.org/broonie/sound/c/4e3bd70facac
[2/6] ASoC: rt712: fix uninitialized stream_config->type
      https://git.kernel.org/broonie/sound/c/0a9bce8a4ff8
[3/6] ASoC: rt1320: fix uninitialized stream_config->type
      https://git.kernel.org/broonie/sound/c/2c68c4a0e570
[4/6] ASoC: rt1318: fix uninitialized stream_config->type
      https://git.kernel.org/broonie/sound/c/c966210ed5f2
[5/6] ASoC: rt721: fix uninitialized stream_config->type
      https://git.kernel.org/broonie/sound/c/0e17e50b9930
[6/6] ASoC: rt722: fix uninitialized stream_config->type
      https://git.kernel.org/broonie/sound/c/cff381508c18

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark