diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-25 05:09:24 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-07-25 18:50:07 +0300 |
commit | 5e291a908869dd4fe70832a89678c6b0c1b8c481 (patch) | |
tree | 04b8f324ba8e5b13b76de283819270df62ce4799 /sound/pci/echoaudio/echoaudio.c | |
parent | a30f1743e4f57b359903fd679476b2903e7e5dac (diff) | |
download | linux-5e291a908869dd4fe70832a89678c6b0c1b8c481.tar.xz |
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>
Diffstat (limited to 'sound/pci/echoaudio/echoaudio.c')
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index b612a536a5a1..ca9125726be2 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -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) { |