mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: topology: Fix null pointer derefence
@ 2025-04-28  9:56 Julien Massot
  2025-04-28 13:10 ` Markus Elfring
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Massot @ 2025-04-28  9:56 UTC (permalink / raw)
  To: kernel, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Daniel Baluta, Kai Vehmanen,
	Pierre-Louis Bossart, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Liam Girdwood, sound-open-firmware, linux-sound, linux-kernel,
	Julien Massot

sof-pdata->machine is null on OF device, since get_function_tplg_files
is only implemented on ACPI device (machine and not of_machine),
check first for null machine.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
Fixes: 6d5997c412cc ("ASoC: SOF: topology: load multiple topologies")
---
 sound/soc/sof/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index e19ba94f2c80a43731b90351bacfde2720db50ed..5d3ee3a86392c5a3fbfd05f83acc99b102c8cf61 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2481,7 +2481,7 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
 	if (!tplg_files)
 		return -ENOMEM;
 
-	if (sof_pdata->machine->get_function_tplg_files) {
+	if (sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
 		tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
 								       sof_pdata->machine,
 								       tplg_filename_prefix,

---
base-commit: 80626102e730787e2cdcab0e36d267bedcd1a63e
change-id: 20250428-fixup-of-sof-topology-50886568a785

Best regards,
-- 
Julien Massot <julien.massot@collabora.com>


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

* Re: [PATCH] ASoC: SOF: topology: Fix null pointer derefence
  2025-04-28  9:56 [PATCH] ASoC: SOF: topology: Fix null pointer derefence Julien Massot
@ 2025-04-28 13:10 ` Markus Elfring
  2025-04-28 13:28   ` Julien Massot
  2025-04-30  0:23   ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Elfring @ 2025-04-28 13:10 UTC (permalink / raw)
  To: Julien Massot, linux-sound, sound-open-firmware
  Cc: kernel, LKML, Bard Liao, Daniel Baluta, Jaroslav Kysela,
	Kai Vehmanen, Liam Girdwood, Liam Girdwood, Mark Brown,
	Péter Ujfalusi, Pierre-Louis Bossart, Ranjani Sridharan,
	Takashi Iwai

…
> check first for null machine.

Would a summary phrase like “Prevent null pointer dereference in snd_sof_load_topology()”
a bit nicer?

Regards,
Markus

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

* Re: [PATCH] ASoC: SOF: topology: Fix null pointer derefence
  2025-04-28 13:10 ` Markus Elfring
@ 2025-04-28 13:28   ` Julien Massot
  2025-04-30  0:23   ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Julien Massot @ 2025-04-28 13:28 UTC (permalink / raw)
  To: Markus Elfring, linux-sound, sound-open-firmware
  Cc: kernel, LKML, Bard Liao, Daniel Baluta, Jaroslav Kysela,
	Kai Vehmanen, Liam Girdwood, Liam Girdwood, Mark Brown,
	Péter Ujfalusi, Pierre-Louis Bossart, Ranjani Sridharan,
	Takashi Iwai

Hi,
On Mon, 2025-04-28 at 15:10 +0200, Markus Elfring wrote:
> Prevent null pointer dereference in snd_sof_load_topology
It sounds better indeed, I will send a v2.

Thanks,
Julien

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

* Re: [PATCH] ASoC: SOF: topology: Fix null pointer derefence
  2025-04-28 13:10 ` Markus Elfring
  2025-04-28 13:28   ` Julien Massot
@ 2025-04-30  0:23   ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-30  0:23 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Julien Massot, linux-sound, sound-open-firmware, kernel, LKML,
	Bard Liao, Daniel Baluta, Jaroslav Kysela, Kai Vehmanen,
	Liam Girdwood, Liam Girdwood, Péter Ujfalusi,
	Pierre-Louis Bossart, Ranjani Sridharan, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

On Mon, Apr 28, 2025 at 03:10:43PM +0200, Markus Elfring wrote:
> …
> > check first for null machine.
> 
> Would a summary phrase like “Prevent null pointer dereference in snd_sof_load_topology()”
> a bit nicer?

Feel free to ignore Markus, he has a long history of sending
unhelpful review comments and continues to ignore repeated requests
to stop.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2025-04-30  0:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-28  9:56 [PATCH] ASoC: SOF: topology: Fix null pointer derefence Julien Massot
2025-04-28 13:10 ` Markus Elfring
2025-04-28 13:28   ` Julien Massot
2025-04-30  0:23   ` 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®