* [PATCH] ASoC: SDCA: Add allocation failure check for Entity name
@ 2026-03-03 14:17 Charles Keepax
2026-03-03 19:42 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2026-03-03 14:17 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, pierre-louis.bossart, yung-chuan.liao, linux-sound,
patches
Currently find_sdca_entity_iot() can allocate a string for the
Entity name but it doesn't check if that allocation succeeded.
Add the missing NULL check after the allocation.
Fixes: 48fa77af2f4a ("ASoC: SDCA: Add terminal type into input/output widget name")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/sdca/sdca_functions.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index a0aed95c76345..257158bc67ea9 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -1156,9 +1156,12 @@ static int find_sdca_entity_iot(struct device *dev,
if (!terminal->is_dataport) {
const char *type_name = sdca_find_terminal_name(terminal->type);
- if (type_name)
+ if (type_name) {
entity->label = devm_kasprintf(dev, GFP_KERNEL, "%s %s",
entity->label, type_name);
+ if (!entity->label)
+ return -ENOMEM;
+ }
}
ret = fwnode_property_read_u32(entity_node,
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: SDCA: Add allocation failure check for Entity name
2026-03-03 14:17 [PATCH] ASoC: SDCA: Add allocation failure check for Entity name Charles Keepax
@ 2026-03-03 19:42 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-03-03 19:42 UTC (permalink / raw)
To: Charles Keepax
Cc: lgirdwood, pierre-louis.bossart, yung-chuan.liao, linux-sound,
patches
On Tue, 03 Mar 2026 14:17:07 +0000, Charles Keepax wrote:
> Currently find_sdca_entity_iot() can allocate a string for the
> Entity name but it doesn't check if that allocation succeeded.
> Add the missing NULL check after the allocation.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SDCA: Add allocation failure check for Entity name
commit: 27990181031fdcdbe0f7c46011f6404e5d116386
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:[~2026-03-03 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 14:17 [PATCH] ASoC: SDCA: Add allocation failure check for Entity name Charles Keepax
2026-03-03 19:42 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox