diff options
author | Mark Brown <broonie@kernel.org> | 2017-11-11 00:30:41 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-11 00:30:41 +0300 |
commit | 60190e46df7fc6e9fe558e3c0aa8af8d70ebc8fa (patch) | |
tree | b4e80524b92ba59d9af6396efad05bbcf591e960 /sound/soc/intel/skylake/skl-sst-utils.c | |
parent | 16a077e17ccf275a56fa21aa36a019ab063064f9 (diff) | |
parent | 3b47c9dc75be097bc0e2f3ac4b176fbf3eed85f2 (diff) | |
download | linux-60190e46df7fc6e9fe558e3c0aa8af8d70ebc8fa.tar.xz |
Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus
Diffstat (limited to 'sound/soc/intel/skylake/skl-sst-utils.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-sst-utils.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index 369ef7ce981c..8ff89280d9fd 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c @@ -251,6 +251,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, struct uuid_module *module; struct firmware stripped_fw; unsigned int safe_file; + int ret = 0; /* Get the FW pointer to derive ADSP header */ stripped_fw.data = fw->data; @@ -299,8 +300,10 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, for (i = 0; i < num_entry; i++, mod_entry++) { module = kzalloc(sizeof(*module), GFP_KERNEL); - if (!module) - return -ENOMEM; + if (!module) { + ret = -ENOMEM; + goto free_uuid_list; + } uuid_bin = (uuid_le *)mod_entry->uuid.id; memcpy(&module->uuid, uuid_bin, sizeof(module->uuid)); @@ -311,8 +314,8 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, size = sizeof(int) * mod_entry->instance_max_count; module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL); if (!module->instance_id) { - kfree(module); - return -ENOMEM; + ret = -ENOMEM; + goto free_uuid_list; } list_add_tail(&module->list, &skl->uuid_list); @@ -323,6 +326,10 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw, } return 0; + +free_uuid_list: + skl_freeup_uuid_list(skl); + return ret; } void skl_freeup_uuid_list(struct skl_sst *ctx) |