summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-08 16:36:20 +0800
committerMark Brown <broonie@kernel.org>2018-09-10 15:20:20 +0100
commitca92cc4636fdedf0d7ee88a5e50cd2b85c246a3b (patch)
tree1af371ece3d3aa8b2677b9e457e564c3cb9afd17
parent18fbe800e6066050ab6ae7751708da04975cdc22 (diff)
ASoC: skl-topology: Use kmemdup to replace kzalloc + memcpy
kmemdup has implemented the function that kzalloc() + memcpy() will do. and we prefer to kmemdup rather than the open coded implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/skylake/skl-topology.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 2620d77729c5..52a9915da0f5 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -898,11 +898,10 @@ static int skl_tplg_set_module_bind_params(struct snd_soc_dapm_widget *w,
bc = (struct skl_algo_data *)sb->dobj.private;
if (bc->set_params == SKL_PARAM_BIND) {
- params = kzalloc(bc->max, GFP_KERNEL);
+ params = kmemdup(bc->params, bc->max, GFP_KERNEL);
if (!params)
return -ENOMEM;
- memcpy(params, bc->params, bc->max);
skl_fill_sink_instance_id(ctx, params, bc->max,
mconfig);