Skip to content

Commit 168d978

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails
Error path in snd_skl_parse_uuids() shall free last allocated module if its instance_id allocation fails. Fixes: f8e0665 ("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>
1 parent 7dd6922 commit 168d978

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/soc/intel/skylake/skl-sst-utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
299299
module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
300300
if (!module->instance_id) {
301301
ret = -ENOMEM;
302+
kfree(module);
302303
goto free_uuid_list;
303304
}
304305

0 commit comments

Comments
 (0)