diff options
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 a4345fc0756..2bb1cee0925 100644 --- a/sound/isa/wavefront/wavefront_fx.c +++ b/sound/isa/wavefront/wavefront_fx.c | |||
@@ -202,15 +202,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file, | |||
202 | "> 512 bytes to FX\n"); | 202 | "> 512 bytes to FX\n"); |
203 | return -EIO; | 203 | return -EIO; |
204 | } | 204 | } |
205 | page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL); | 205 | page_data = memdup_user((unsigned char __user *) |
206 | if (!page_data) | 206 | r.data[3], |
207 | return -ENOMEM; | 207 | r.data[2] * sizeof(short)); |
208 | if (copy_from_user (page_data, | 208 | if (IS_ERR(page_data)) |
209 | (unsigned char __user *) r.data[3], | 209 | return PTR_ERR(page_data); |
210 | r.data[2] * sizeof(short))) { | ||
211 | kfree(page_data); | ||
212 | return -EFAULT; | ||
213 | } | ||
214 | pd = page_data; | 210 | pd = page_data; |
215 | } | 211 | } |
216 | 212 | ||