summaryrefslogtreecommitdiff
path: root/sound/soc/intel/skylake/skl-sst-utils.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-01-08 18:54:50 +0300
committerMark Brown <broonie@kernel.org>2018-01-08 18:54:50 +0300
commit498495dba268b20e8eadd7fe93c140c68b6cc9d2 (patch)
tree00d1562049d8bc2194fddd9ba0cbbe0812ad6f68 /sound/soc/intel/skylake/skl-sst-utils.c
parentd5cc0a1fcbb5ddbef9fdd4c4a978da3254ddbf37 (diff)
parent5c256045b87b8aa8e5bc9d2e2fdc0802351c1f99 (diff)
downloadlinux-498495dba268b20e8eadd7fe93c140c68b6cc9d2.tar.xz
Merge branch 'fix/intel' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
Diffstat (limited to 'sound/soc/intel/skylake/skl-sst-utils.c')
-rw-r--r--sound/soc/intel/skylake/skl-sst-utils.c15
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 746df24bfd82..2ae405617876 100644
--- a/sound/soc/intel/skylake/skl-sst-utils.c
+++ b/sound/soc/intel/skylake/skl-sst-utils.c
@@ -253,6 +253,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;
@@ -301,8 +302,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));
@@ -313,8 +316,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);
@@ -325,6 +328,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)