summaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront_fx.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-04-15 11:24:27 +0200
committerTakashi Iwai <tiwai@suse.de>2009-04-15 11:24:27 +0200
commitf4723b224d21ff546ac1fea4483094548d529479 (patch)
tree1257dceebcacbf04d3cd6eabf7ff75cfac2edd96 /sound/isa/wavefront/wavefront_fx.c
parent00610a81df32ea50dba0105078e7369988caef3b (diff)
parent336500f0305dc1552e8d01a60b409a7db781ca28 (diff)
downloadop-kernel-dev-f4723b224d21ff546ac1fea4483094548d529479.zip
op-kernel-dev-f4723b224d21ff546ac1fea4483094548d529479.tar.gz
Merge branch 'topic/memdup_user' into for-linus
* topic/memdup_user: ALSA: sound/pci: use memdup_user() ALSA: sound/usb: use memdup_user() ALSA: sound/isa: use memdup_user() ALSA: sound/core: use memdup_user()
Diffstat (limited to 'sound/isa/wavefront/wavefront_fx.c')
-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 a4345fc..2bb1cee 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,
"> 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;
}
OpenPOWER on IntegriCloud