From 02a844ff59ec08f96d787e9a5d142ce63a08d4d4 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Wed, 15 Apr 2026 09:13:58 +0800 Subject: [PATCH] fixup! ASoC: SOF: topology: allow user to add topologies add a out of memory check. Signed-off-by: Bard Liao --- sound/soc/sof/topology.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 303cce08540ea8..634a944758f2bb 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2595,6 +2595,10 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file) tplg_filename_prefix, feature_topologies[i]); + if (!feature_topology) { + ret = -ENOMEM; + goto out; + } dev_info(scomp->dev, "loading feature topology %d: %s\n", i, feature_topology); ret = request_firmware(&fw, feature_topology, scomp->dev); if (ret < 0) {