diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-10 09:43:36 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 12:39:23 +0200 |
commit | 68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (patch) | |
tree | ea68aa46121d17114732442d9730a22292606e46 /sound/isa/wavefront/wavefront_fx.c | |
parent | ef44a1ec6eeef189998f84e7230e1d3535b01074 (diff) | |
download | op-kernel-dev-68425adcc419bfe90776f59e66b8c4cdb6e1b1f3.zip op-kernel-dev-68425adcc419bfe90776f59e66b8c4cdb6e1b1f3.tar.gz |
ALSA: sound/isa: use memdup_user()
Remove open-coded memdup_user().
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/wavefront/wavefront_fx.c')
-rw-r--r-- | sound/isa/wavefront/wavefront_fx.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c index dfc449a..5e6870b 100644 --- a/sound/isa/wavefront/wavefront_fx.c +++ b/sound/isa/wavefront/wavefront_fx.c @@ -210,15 +210,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file, "> 512 bytes to FX\n"); return -EIO; } - page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); - if (!page_data) - return -ENOMEM; - if (copy_from_user (page_data, - (unsigned char __user *) r.data[3], - r.data[2] * sizeof(short))) { - kfree(page_data); - return -EFAULT; - } + page_data = memdup_user((unsigned char __user *) + r.data[3], + r.data[2] * sizeof(short)); + if (IS_ERR(page_data)) + return PTR_ERR(page_data); pd = page_data; } |