Commit 376c0afe authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Mark Brown

ASoC: topology: use kmemdup rather than duplicating its implementation

The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4ca7deb1
...@@ -832,12 +832,12 @@ static int soc_tplg_denum_create_values(struct soc_enum *se, ...@@ -832,12 +832,12 @@ static int soc_tplg_denum_create_values(struct soc_enum *se,
if (ec->items > sizeof(*ec->values)) if (ec->items > sizeof(*ec->values))
return -EINVAL; return -EINVAL;
se->dobj.control.dvalues = se->dobj.control.dvalues = kmemdup(ec->values,
kmalloc(ec->items * sizeof(u32), GFP_KERNEL); ec->items * sizeof(u32),
GFP_KERNEL);
if (!se->dobj.control.dvalues) if (!se->dobj.control.dvalues)
return -ENOMEM; return -ENOMEM;
memcpy(se->dobj.control.dvalues, ec->values, ec->items * sizeof(u32));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment