aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront_fx.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-10 09:43:36 +0800
committerTakashi Iwai <tiwai@suse.de>2009-04-14 12:39:23 +0200
commit68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (patch)
treeea68aa46121d17114732442d9730a22292606e46 /sound/isa/wavefront/wavefront_fx.c
parentALSA: sound/core: use memdup_user() (diff)
downloadlinux-dev-68425adcc419bfe90776f59e66b8c4cdb6e1b1f3.tar.xz
linux-dev-68425adcc419bfe90776f59e66b8c4cdb6e1b1f3.zip
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 '')
-rw-r--r--sound/isa/wavefront/wavefront_fx.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index dfc449a2194e..5e6870baa296 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;
}