diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-09 21:43:36 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-04-14 06:39:23 -0400 |
commit | 68425adcc419bfe90776f59e66b8c4cdb6e1b1f3 (patch) | |
tree | ea68aa46121d17114732442d9730a22292606e46 /sound/isa/wavefront/wavefront_fx.c | |
parent | ef44a1ec6eeef189998f84e7230e1d3535b01074 (diff) |
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 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, | |||
210 | "> 512 bytes to FX\n"); | 210 | "> 512 bytes to FX\n"); |
211 | return -EIO; | 211 | return -EIO; |
212 | } | 212 | } |
213 | page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); | 213 | page_data = memdup_user((unsigned char __user *) |
214 | if (!page_data) | 214 | r.data[3], |
215 | return -ENOMEM; | 215 | r.data[2] * sizeof(short)); |
216 | if (copy_from_user (page_data, | 216 | if (IS_ERR(page_data)) |
217 | (unsigned char __user *) r.data[3], | 217 | return PTR_ERR(page_data); |
218 | r.data[2] * sizeof(short))) { | ||
219 | kfree(page_data); | ||
220 | return -EFAULT; | ||
221 | } | ||
222 | pd = page_data; | 218 | pd = page_data; |
223 | } | 219 | } |
224 | 220 | ||