ALSA: echoaudio: Replace kmalloc + memcpy with kmemdup

Instead of using kmalloc + memcpy, use kmemdup
to simplify the code.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
这个提交包含在:
Chuhong Yuan
2019-07-25 10:09:24 +08:00
提交者 Takashi Iwai
父节点 a30f1743e4
当前提交 5e291a9088

查看文件

@@ -2189,11 +2189,10 @@ static int snd_echo_resume(struct device *dev)
u32 pipe_alloc_mask;
int err;
commpage_bak = kmalloc(sizeof(*commpage), GFP_KERNEL);
commpage = chip->comm_page;
commpage_bak = kmemdup(commpage, sizeof(*commpage), GFP_KERNEL);
if (commpage_bak == NULL)
return -ENOMEM;
commpage = chip->comm_page;
memcpy(commpage_bak, commpage, sizeof(*commpage));
err = init_hw(chip, chip->pci->device, chip->pci->subsystem_device);
if (err < 0) {