linux-hardened/sound/soc
Richard Fitzgerald 5653a6d65a ASoC: wm_adsp: Don't overwrite fwf_name with the default
[ Upstream commit daf3f0f99cde93a066240462b7a87cdfeedc04c0 ]

There's no need to overwrite fwf_name with a kstrdup() of the cs_dsp part
name. It is trivial to select either fwf_name or cs_dsp.part as the string
to use when building the filename in wm_adsp_request_firmware_file().

This leaves fwf_name entirely owned by the codec driver.

It also avoids problems with freeing the pointer. With the original code
fwf_name was either a pointer owned by the codec driver, or a kstrdup()
created by wm_adsp. This meant wm_adsp must free it if it set it, but not
if the codec driver set it. The code was handling this by using
devm_kstrdup().
But there is no absolute requirement that wm_adsp_common_init() must be
called from probe(), so this was a pseudo-memory leak - each new call to
wm_adsp_common_init() would allocate another block of memory but these
would only be freed if the owning codec driver was removed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://msgid.link/r/20240129162737.497-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-01 13:26:27 +01:00
..
adi
amd ASoC: amd: yc: Add DMI quirk for Lenovo Ideapad Pro 5 16ARP8 2024-02-23 09:12:45 +01:00
apple
atmel ASoC: atmel: Fix the 8K sample parameter in I2SC master 2023-09-13 09:42:22 +02:00
au1x
bcm
cirrus
codecs ASoC: wm_adsp: Don't overwrite fwf_name with the default 2024-03-01 13:26:27 +01:00
dwc ASoC: dwc: move DMA init to snd_soc_dai_driver probe() 2023-06-21 16:00:53 +02:00
fsl ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable 2024-01-10 17:10:23 +01:00
generic ASoC: simple-card: fixup asoc_simple_probe() error handling 2023-11-08 14:10:57 +01:00
hisilicon
img
intel ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch 2024-01-25 15:27:33 -08:00
jz4740
kirkwood
mediatek ASoC: mediatek: sof-common: Add NULL check for normal_link string 2024-01-25 15:27:48 -08:00
meson ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux 2024-01-10 17:10:25 +01:00
mxs
pxa ASoC: pxa: fix a memory leak in probe() 2023-10-25 12:03:15 +02:00
qcom ASoC: qcom: q6apm: do not close GPR port before closing graph 2023-07-27 08:50:37 +02:00
rockchip
samsung
sh ASoC: Use of_property_read_bool() for boolean properties 2023-10-19 23:08:51 +02:00
sof ASoC: SOF: Intel: hda-codec: Delay the codec device registration 2024-01-20 11:50:10 +01:00
spear
sprd
sti
stm
sunxi ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616 2024-03-01 13:26:27 +01:00
tegra ASoC: tegra: Fix redundant PLLA and PLLA_OUT0 updates 2023-10-10 22:00:34 +02:00
ti ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings 2023-11-28 17:07:02 +00:00
uniphier
ux500
xilinx
xtensa
Kconfig
Makefile
soc-ac97.c
soc-acpi.c
soc-card.c
soc-component.c
soc-compress.c ASoC: soc-compress: Inherit atomicity from DAI link for Compress FE 2023-05-11 23:03:28 +09:00
soc-core.c
soc-dai.c
soc-dapm.c ASoC: dapm: fix clock get name 2023-11-20 11:52:18 +01:00
soc-devres.c
soc-generic-dmaengine-pcm.c
soc-jack.c
soc-link.c
soc-ops.c ASoC: ops: add correct range check for limiting volume 2024-01-20 11:50:06 +01:00
soc-pcm.c ASoC: soc-pcm: test if a BE can be prepared 2023-06-21 16:00:53 +02:00
soc-topology-test.c
soc-topology.c
soc-utils-test.c
soc-utils.c ASoC: soc-utils: Export snd_soc_dai_is_dummy() symbol 2023-10-10 22:00:34 +02:00