Skip to content

Commit

Permalink
module_adapter: clean up module_load_config
Browse files Browse the repository at this point in the history
Now that validate_config has been deleted we can clean up some of the
error handling logic here.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
  • Loading branch information
cujomalainey committed Aug 21, 2024
1 parent 010fcbd commit 72bb638
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size)
}
if (!dst->data) {
comp_err(dev, "module_load_config(): failed to allocate space for setup config.");
ret = -ENOMEM;
goto err;
return -ENOMEM;
}

ret = memcpy_s(dst->data, size, cfg, size);
Expand All @@ -65,11 +64,6 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size)

comp_dbg(dev, "module_load_config() done");
return ret;
err:
if (dst->data)
rfree(dst->data);
dst->data = NULL;
return ret;
}

int module_init(struct processing_module *mod)
Expand Down

0 comments on commit 72bb638

Please sign in to comment.