Commit 5e291a90 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Takashi Iwai

ALSA: echoaudio: Replace kmalloc + memcpy with kmemdup

Instead of using kmalloc + memcpy, use kmemdup
to simplify the code.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a30f1743
...@@ -2189,11 +2189,10 @@ static int snd_echo_resume(struct device *dev) ...@@ -2189,11 +2189,10 @@ static int snd_echo_resume(struct device *dev)
u32 pipe_alloc_mask; u32 pipe_alloc_mask;
int err; 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) if (commpage_bak == NULL)
return -ENOMEM; return -ENOMEM;
commpage = chip->comm_page;
memcpy(commpage_bak, commpage, sizeof(*commpage));
err = init_hw(chip, chip->pci->device, chip->pci->subsystem_device); err = init_hw(chip, chip->pci->device, chip->pci->subsystem_device);
if (err < 0) { if (err < 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