linux/sound/soc/sof
Zhao Dongdong d46f9f2389
ASoC: SOF: topology: fix memory leak in snd_sof_load_topology
When the topology filename contains "dummy" and tplg_cnt is 0, the
function returns -EINVAL directly without freeing the tplg_files
allocated by kcalloc() at line 2497. This leaks memory on every
such topology load attempt.

Fix this by setting ret = -EINVAL and jumping to the out: label,
which already handles the kfree(tplg_files) cleanup.

Fixes: 99c159279c ("ASoC: SOF: don't check the existence of dummy topology")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/tencent_3EED6D778DC52C3703A2D1EE8119372E8E08@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-06-11 21:41:33 +01:00
..
amd ASoC: cs35l56: Fix some cleanup memory leaks 2026-06-10 11:24:47 +01:00
imx ASoC: SOF: imx: imx-common: Use guard() for spinlock_irqsafe() 2026-01-12 11:21:26 +00:00
intel ASoC: SOF: Intel: hda-sdw-bpt: select SND_SOF_SOF_HDA_SDW_BPT properly 2026-06-11 20:40:10 +01:00
mediatek ASoC: SOF: mediatek: mtk-adsp-common: Use guard() for spinlock_irqsave 2026-01-12 11:21:27 +00:00
xtensa module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
compress.c ASoC: SOF: Don't allow pointer operations on unconfigured streams 2026-04-10 13:57:09 +01:00
control.c ASoC: SOF: Add support for on-demand DSP boot 2025-12-15 23:07:41 +09:00
core.c ASoC: SOF: Add support for on-demand DSP boot 2025-12-15 23:07:41 +09:00
debug.c ASoC: SOF: Add support for on-demand DSP boot 2025-12-15 23:07:41 +09:00
fw-file-profile.c ASoC: SOF: Fix function topology name check in profile info output 2025-10-23 13:42:47 +01:00
iomem-utils.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ipc.c ASoC: SOF: ipc/ops: Use guard() for spinlocks 2026-01-12 11:21:29 +00:00
ipc3-control.c ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/get 2026-06-09 18:41:14 +01:00
ipc3-dtrace.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ipc3-loader.c ASoC: SOF: ipc3-loader: 'Handle' PROBE_INFO ext_manifest type when parsing 2024-11-07 13:03:23 +00:00
ipc3-pcm.c ASoC: SOF: pcm: Add snd_sof_pcm specific wrappers for dev_dbg() and dev_err() 2025-02-06 11:25:43 +00:00
ipc3-priv.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
ipc3-topology.c ASoC: SOF: Validate and correct the core id against the number of cores of the DSP 2026-05-21 11:25:22 +01:00
ipc3.c ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense 2026-01-12 11:21:24 +00:00
ipc4-control.c ASoC: SOF: ipc4-control: Validate notification payload size 2026-06-09 18:41:10 +01:00
ipc4-fw-reg.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
ipc4-loader.c ASoC: SOF: ipc4-loader: Remove redundant rpm resume_and_get from load_library 2025-12-15 23:07:40 +09:00
ipc4-mtrace.c ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense 2026-01-12 11:21:24 +00:00
ipc4-pcm.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
ipc4-priv.h ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg 2025-06-20 11:33:05 +01:00
ipc4-telemetry.c ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
ipc4-telemetry.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
ipc4-topology.c ASoC: SOF: ipc4-topology: Support for multiple src output formats 2026-05-26 17:50:18 +01:00
ipc4-topology.h ASoC: SOF: ipc4-topology: Add new tokens for pipeline direction 2026-02-04 13:26:05 +00:00
ipc4.c ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense 2026-01-12 11:21:24 +00:00
Kconfig ASoC: sof: Standardize ASoC menu 2025-06-24 01:01:18 +01:00
loader.c ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
Makefile ASoC: SOF: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:30 +09:00
nocodec.c ASoC: soc-card: add snd_soc_card_set_topology_name() 2026-05-28 12:18:29 +01:00
ops.c ASoC: SOF: ipc/ops: Use guard() for spinlocks 2026-01-12 11:21:29 +00:00
ops.h ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense 2026-01-12 11:21:24 +00:00
pcm.c ASoC: SOF: sof-audio: pcm_id is __le32 2026-03-24 13:53:37 +00:00
pm.c ASoC: SOF: Add support for on-demand DSP boot 2025-12-15 23:07:41 +09:00
sof-acpi-dev.c ASoC: SOF: acpi: Convert to EXPORT_NS_DEV_PM_OPS() 2025-03-17 10:14:55 +00:00
sof-acpi-dev.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
sof-audio.c ASoC: SOF: sof-audio: Add support for loopback capture 2026-02-04 13:26:08 +00:00
sof-audio.h ASoC: SOF: topology: use kzalloc_flex 2026-03-30 20:11:31 +01:00
sof-client-ipc-flood-test.c ASoC: SOF: sof-client: Add support for on-demand DSP boot 2025-12-15 23:07:42 +09:00
sof-client-ipc-kernel-injector.c ASoC: SOF: sof-client: Add support for on-demand DSP boot 2025-12-15 23:07:42 +09:00
sof-client-ipc-msg-injector.c ASoC: SOF: sof-client: Add support for on-demand DSP boot 2025-12-15 23:07:42 +09:00
sof-client-probes-ipc3.c ASoC: SOF: sof-client-probes: Add available points_info(), IPC4 only 2025-08-29 13:34:19 +02:00
sof-client-probes-ipc4.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sof-client-probes.c ASoC: SOF: sof-client: Add support for on-demand DSP boot 2025-12-15 23:07:42 +09:00
sof-client-probes.h ASoC: Updates for v6.18 2025-09-20 08:38:17 +02:00
sof-client.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sof-client.h ASoC: SOF: sof-client: Add support for on-demand DSP boot 2025-12-15 23:07:42 +09:00
sof-of-dev.c ASoC: SOF: of: Convert to EXPORT_DEV_PM_OPS() 2025-03-17 10:14:57 +00:00
sof-of-dev.h ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c 2023-12-04 17:02:15 +00:00
sof-pci-dev.c ASoC: sof: Use pure devres PCI 2025-05-05 19:32:11 +09:00
sof-pci-dev.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
sof-priv.h ASoC: SOF: compress: return the configured codec from get_params 2026-04-06 13:11:57 +01:00
sof-utils.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sof-utils.h ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00
stream-ipc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
topology.c ASoC: SOF: topology: fix memory leak in snd_sof_load_topology 2026-06-11 21:41:33 +01:00
trace.c ASoC: SOF: Intel: clarify Copyright information 2024-05-06 23:59:35 +09:00