summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2023-10-26 10:25:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 10:30:13 +0100
commit4634c9cc726dbe102b4cf3f07eaaf1ed4d0f1d1c (patch)
tree085ab48fce8a72b239f4dac62e9571c2a0499c22 /sound
parent66888e6953f8f3e0426b6d0512b9943fd0d3f232 (diff)
ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails
[ Upstream commit 168d97844a61db302dec76d44406e9d4d7106b8e ] Error path in snd_skl_parse_uuids() shall free last allocated module if its instance_id allocation fails. Fixes: f8e066521192 ("ASoC: Intel: Skylake: Fix uuid_module memory leak in failure case") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20231026082558.1864910-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/skylake/skl-sst-utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c
index d43cbf4a71ef..d4db64d72b2c 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -299,6 +299,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
if (!module->instance_id) {
ret = -ENOMEM;
+ kfree(module);
goto free_uuid_list;
}