mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback
@ 2025-09-19 14:02 Richard Fitzgerald
  2025-09-19 20:13 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2025-09-19 14:02 UTC (permalink / raw)
  To: broonie, yung-chuan.liao, peter.ujfalusi, kai.vehmanen
  Cc: linux-sound, linux-kernel, patches

In create_sdw_dailink() check that sof_end->codec_info->add_sidecar
is not NULL before calling it.

The original code assumed that if include_sidecar is true, the codec
on that link has an add_sidecar callback. But there could be other
codecs on the same link that do not have an add_sidecar callback.

Fixes: da5244180281 ("ASoC: Intel: sof_sdw: Add callbacks to register sidecar devices")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/intel/boards/sof_sdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 28f03a5f29f7..c013e31d098e 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -841,7 +841,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
 			(*codec_conf)++;
 		}
 
-		if (sof_end->include_sidecar) {
+		if (sof_end->include_sidecar && sof_end->codec_info->add_sidecar) {
 			ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf);
 			if (ret)
 				return ret;
-- 
2.39.5


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

* Re: [PATCH] ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback
  2025-09-19 14:02 [PATCH] ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback Richard Fitzgerald
@ 2025-09-19 20:13 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-09-19 20:13 UTC (permalink / raw)
  To: yung-chuan.liao, peter.ujfalusi, kai.vehmanen, Richard Fitzgerald
  Cc: linux-sound, linux-kernel, patches

On Fri, 19 Sep 2025 15:02:35 +0100, Richard Fitzgerald wrote:
> In create_sdw_dailink() check that sof_end->codec_info->add_sidecar
> is not NULL before calling it.
> 
> The original code assumed that if include_sidecar is true, the codec
> on that link has an add_sidecar callback. But there could be other
> codecs on the same link that do not have an add_sidecar callback.
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback
      commit: 87cab86925b7fa4c1c977bc191ac549a3b23f0ea

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


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

end of thread, other threads:[~2025-09-19 20:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-19 14:02 [PATCH] ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback Richard Fitzgerald
2025-09-19 20:13 ` Mark Brown

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®