forked from Minki/linux
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>
This commit is contained in:
parent
18fbe800e6
commit
ca92cc4636
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user