Skip to content

Commit

Permalink
ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails
Browse files Browse the repository at this point in the history
[ Upstream commit 168d978 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
crojewsk-intel authored and gregkh committed Nov 20, 2023
1 parent b8ead75 commit 74cc5cb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/intel/skylake/skl-sst-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,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;
}

Expand Down

0 comments on commit 74cc5cb

Please sign in to comment.