提交 376c0afe 编写于 作者: A Andrzej Hajda 提交者: 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: NAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 4ca7deb1
......@@ -832,12 +832,12 @@ static int soc_tplg_denum_create_values(struct soc_enum *se,
if (ec->items > sizeof(*ec->values))
return -EINVAL;
se->dobj.control.dvalues =
kmalloc(ec->items * sizeof(u32), GFP_KERNEL);
se->dobj.control.dvalues = kmemdup(ec->values,
ec->items * sizeof(u32),
GFP_KERNEL);
if (!se->dobj.control.dvalues)
return -ENOMEM;
memcpy(se->dobj.control.dvalues, ec->values, ec->items * sizeof(u32));
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册