linux-stable/sound/soc/sof
Cristian Ciocaltea 222be59e5e
ASoC: SOF: amd: Fix memory leak in amd_sof_acp_probe()
Driver uses kasprintf() to initialize fw_{code,data}_bin members of
struct acp_dev_data, but kfree() is never called to deallocate the
memory, which results in a memory leak.

Fix the issue by switching to devm_kasprintf(). Additionally, ensure the
allocation was successful by checking the pointer validity.

Fixes: f7da88003c ("ASoC: SOF: amd: Enable signed firmware image loading for Vangogh platform")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231219030728.2431640-6-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-01-22 00:06:28 +00:00
..
amd ASoC: SOF: amd: Fix memory leak in amd_sof_acp_probe() 2024-01-22 00:06:28 +00:00
imx ASoC: SOF: imx: Add SNDRV_PCM_INFO_BATCH flag 2023-12-29 02:09:02 +00:00
intel ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
mediatek ASoC: SOF: mediatek: mt8186: Revert Add Google Steelix topology compatible 2023-12-06 16:31:09 +00:00
xtensa ASoC: SOF: Xtensa: dump ar registers to restore call stack 2023-09-19 13:48:44 +01:00
compress.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
control.c ASoC: SOF: control: Extend the optionality of IPC ops to IPC as well 2022-12-25 23:32:33 +00:00
core.c ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c 2023-12-04 17:02:15 +00:00
debug.c ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions 2023-05-15 10:20:57 +09:00
fw-file-profile.c ASoC: SOF: core: Implement IPC version fallback if firmware files are missing 2023-11-29 13:25:15 +00:00
iomem-utils.c
ipc.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
ipc3-control.c ASoC: sof: Improve sof_ipc3_bytes_ext_put function 2023-05-23 19:31:14 +01:00
ipc3-dtrace.c ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage" 2024-01-12 14:13:52 +00:00
ipc3-loader.c ASoC: SOF: Introduce container struct for SOF firmware 2022-10-21 13:04:54 +01:00
ipc3-pcm.c ASoC: SOF: Add support for configuring PDM interface from topology 2023-11-13 00:43:06 +00:00
ipc3-priv.h ASoC: SOF: Refactor rx function for fuzzing 2023-06-09 10:44:39 +01:00
ipc3-topology.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
ipc3.c ASoC: SOF: ipc3: Use devm_kmemdup to replace devm_kmalloc + memcpy 2023-08-14 19:44:39 +01:00
ipc4-control.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
ipc4-fw-reg.h ASoC: SOF: add ipc4_fw_reg header file 2023-02-03 12:03:48 +00:00
ipc4-loader.c ASoC: SOF: ipc4-loader: remove the CPC check warnings 2024-01-15 14:04:52 +00:00
ipc4-mtrace.c ASoC: SOF: ipc4-mtrace: move debug slot related definitions to header.h 2023-09-19 13:48:45 +01:00
ipc4-pcm.c ASoC: SOF: ipc4-pcm: remove log message for LLP 2024-01-15 14:04:51 +00:00
ipc4-priv.h ASoC: SOF: IPC4: query fw_context_save feature from fw 2023-12-15 12:57:56 +00:00
ipc4-telemetry.c ASoC: SOF: ipc4: add definition of telemetry slot for exception handling 2023-09-19 13:48:47 +01:00
ipc4-telemetry.h ASoC: SOF: ipc4: add definition of telemetry slot for exception handling 2023-09-19 13:48:47 +01:00
ipc4-topology.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
ipc4-topology.h ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module 2023-12-01 14:13:03 +00:00
ipc4.c ASoC: SOF: ipc4: Move window offset configuration earlier 2023-11-29 13:25:26 +00:00
Kconfig ASoC: SOF: core: Implement IPC version fallback if firmware files are missing 2023-11-29 13:25:15 +00:00
loader.c ASoC: SOF: loader: Remove log prefixes for snd_sof_run_firmware 2023-03-07 13:58:16 +00:00
Makefile ASoC: SOF: core: Implement firmware, topology path setup in core 2023-11-29 13:25:09 +00:00
nocodec.c ASoC: sof: convert not to use asoc_xxx() 2023-09-26 17:18:42 +02:00
ops.c
ops.h ASoC: SOF: Make return of remove_late void, too 2023-10-25 08:38:35 +02:00
pcm.c ASoC: sof: convert not to use asoc_xxx() 2023-09-26 17:18:42 +02:00
pm.c ASoC: SOF: pm: Remove duplicated code in sof_suspend 2023-06-16 12:53:53 +01:00
sof-acpi-dev.c ASoC: SOF: sof-acpi-dev: Rely on core to create the file paths 2023-11-29 13:25:10 +00:00
sof-acpi-dev.h ASoC: SOF: Convert to platform remove callback returning void 2023-10-10 19:21:04 +01:00
sof-audio.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
sof-audio.h ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
sof-client-ipc-flood-test.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
sof-client-ipc-kernel-injector.c ASoC: SOF: Add IPC3 Kernel Injector 2023-06-09 10:44:40 +01:00
sof-client-ipc-msg-injector.c ASoC: SOF: Use generic names for IPC types 2023-09-19 13:49:08 +01:00
sof-client-probes-ipc3.c ASoC: SOF: Use no_reply calls for TX 2023-04-20 12:51:45 +01:00
sof-client-probes-ipc4.c ASoC: SOF: sof-client-probes-ipc4: add checks to prevent static analysis warnings 2023-07-31 23:22:12 +01:00
sof-client-probes.c ASoC: sof: use snd_soc_dummy_dlc 2023-12-19 13:23:45 +00:00
sof-client-probes.h ASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device 2022-10-31 13:20:22 +00:00
sof-client.c ASoC: SOF: sof-client: trivial: fix comment typo 2023-11-07 11:10:19 +00:00
sof-client.h ASoC: SOF: Add IPC3 Kernel Injector 2023-06-09 10:44:40 +01:00
sof-of-dev.c ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c 2023-12-04 17:02:15 +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: sof-pci-dev: Rely on core to create the file paths 2023-11-29 13:25:12 +00:00
sof-pci-dev.h
sof-priv.h ASoC: SOF: core: Implement firmware, topology path setup in core 2023-11-29 13:25:09 +00:00
sof-utils.c ASoC: SOF: remove unneeded dev_vdbg 2022-09-19 15:44:06 +01:00
sof-utils.h
stream-ipc.c ASoC: SOF: Add support for compress API for stream data/offset 2023-01-17 13:37:53 +00:00
topology.c ASoC: Updates for v6.8 2024-01-08 08:18:02 +01:00
trace.c ASoC: SOF: trace: No need to check for op pointer in sof_fw_trace_free() 2022-12-25 23:32:39 +00:00